Skip to content

Commit a1bb661

Browse files
authored
docs: misc improvements (payloadcms#7107)
1 parent e2b06ab commit a1bb661

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+215
-199
lines changed

Diff for: docs/admin/overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ desc: Manage your data and customize the Payload Admin Panel by swapping in your
66
keywords: admin, components, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
77
---
88

9-
Payload dynamically generates a beautiful, [fully type-safe](../typescript/overview) admin panel to manage your users and data. It is highly performant, even with 100+ fields, and is translated in over 30 languages. Within the Admin Panel you can manage content, [render your site](../live-preview/overview), preview drafts, [diff versions](../versions/overview), and so much more.
9+
Payload dynamically generates a beautiful, [fully type-safe](../typescript/overview) Admin Panel to manage your users and data. It is highly performant, even with 100+ fields, and is translated in over 30 languages. Within the Admin Panel you can manage content, [render your site](../live-preview/overview), preview drafts, [diff versions](../versions/overview), and so much more.
1010

1111
The Admin Panel is designed to [white-label your brand](https://payloadcms.com/blog/white-label-admin-ui). You can endlessly customize and extend the Admin UI by swapping in your own [Custom Components](./components)—everything from simple field labels to entire views can be modified or replaced to perfectly tailor the interface for your editors.
1212

Diff for: docs/authentication/config.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Example:
169169
### Admin autologin
170170

171171
For testing and demo purposes you may want to skip forcing the admin user to login in order to access the panel.
172-
The `admin.autologin` property is used to configure the how visitors are handled when accessing the admin panel.
172+
The `admin.autologin` property is used to configure the how visitors are handled when accessing the Admin Panel.
173173
The default is that all users will have to login and this should not be enabled for environments where data needs to protected.
174174

175175
#### autoLogin Options

Diff for: docs/authentication/http-only-cookies.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ In this scenario, if your cookie was still valid, malicious-intent.com would be
6565

6666
### CSRF Prevention
6767

68-
Define domains that your trust and are willing to accept Payload HTTP-only cookie based requests from. Use the `csrf` option on the base Payload config to do this:
68+
Define domains that your trust and are willing to accept Payload HTTP-only cookie based requests from. Use the `csrf` option on the base Payload Config to do this:
6969

7070
```ts
7171
// payload.config.ts

Diff for: docs/authentication/overview.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ keywords: authentication, config, configuration, overview, documentation, Conten
1818

1919
Authentication is used within the [Admin Panel](../admin/overview) itself as well as throughout your app(s) themselves however you determine necessary.
2020

21-
![Authentication admin panel functionality](https://payloadcms.com/images/docs/auth-admin.jpg)
21+
![Authentication Admin Panel functionality](https://payloadcms.com/images/docs/auth-admin.jpg)
2222
_Admin Panel screenshot depicting an Admins Collection with Auth enabled_
2323

2424
**Here are some common use cases of Authentication outside of Payload's dashboard itself:**
@@ -73,7 +73,7 @@ Once enabled, each document that is created within the Collection can be thought
7373

7474
## Authentication Strategies
7575

76-
Out of the box Payload ships with a few powerful authentication strategies. HTTP-Only Cookies, JWT's and API-Keys, they can work together or individually. You can also have multiple collections that have auth enabled, but only 1 of them can be used to log into the admin panel.
76+
Out of the box Payload ships with a few powerful authentication strategies. HTTP-Only Cookies, JWT's and API-Keys, they can work together or individually. You can also have multiple collections that have auth enabled, but only 1 of them can be used to log into the Admin Panel.
7777

7878
### HTTP-Only Cookies
7979

Diff for: docs/cloud/projects.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ From there, you are ready to make updates to your project. When you are ready to
9898

9999
## Cloud Plugin
100100

101-
Projects generated from a template will come pre-configured with the official Cloud Plugin, but if you are using your own repository you will need to add this into your project. To do so, add the plugin to your Payload config:
101+
Projects generated from a template will come pre-configured with the official Cloud Plugin, but if you are using your own repository you will need to add this into your project. To do so, add the plugin to your Payload Config:
102102

103103
`yarn add @payloadcms/plugin-cloud`
104104

@@ -113,7 +113,7 @@ export default buildConfig({
113113
```
114114

115115
<Banner type="warning">
116-
**Note:** If your Payload config already has an email with transport, this will take precedence
116+
**Note:** If your Payload Config already has an email with transport, this will take precedence
117117
over Payload Cloud's email service.
118118
</Banner>
119119

Diff for: docs/configuration/collections.mdx

+23-17
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ desc: Structure your Collections for your needs by defining fields, adding slugs
66
keywords: collections, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
77
---
88

9-
A Collection is a group of records, called Documents, that share a schema. You can define as many Collections as your application needs. Each Collection will automatically scaffold a new collection or table in your [Database](../database/overview) based on the [Fields](../fields/overview) that you define.
9+
A Collection is a group of records, called Documents, that share a common schema. You can define as many Collections as your application needs. Each Collection saves to the [Database](../database/overview) based on the [Fields](../fields/overview) that you define.
10+
11+
Collections are the primary way to structure recurring data in your application, such as users, products, pages, posts, and other types of content that you might want to manage. Each Collection can have its own unique [Access Control](../access-control/overview), [Hooks](../hooks/overview), [Admin Options](#admin-options), and more.
12+
13+
Collections will automatically generate their own [Local API](../local-api/overview). If your application is using the [Admin Panel](../admin/overview), you will also get a fully-featured [REST API](../rest-api/overview) and [GraphQL API](../graphql/overview) without any additional configuration.
1014

1115
To define a Collection Config, use the `collection` property in your [Payload Config](./overview):
1216

@@ -43,7 +47,7 @@ export const Posts: CollectionConfig = {
4347

4448
<Banner type="success">
4549
<strong>Reminder:</strong>
46-
For a more complex example, see the [Public Demo](https://github.com/payloadcms/public-demo) source code on GitHub.
50+
For a more complex example, see the [Public Demo](https://github.com/payloadcms/public-demo) source code on GitHub, or the [Templates](https://github.com/payloadcms/payload/tree/main/templates) and [Examples](https://github.com/payloadcms/payload/tree/main/examples) directories in the Payload repository.
4751
</Banner>
4852

4953
The following options are available:
@@ -60,7 +64,7 @@ The following options are available:
6064
| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More details](../rest-api/overview#custom-endpoints). |
6165
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](../fields/overview) for a full list of field types as well as how to configure them. |
6266
| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. Set to `false` to disable GraphQL. |
63-
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More details](../hooks/overview#collection-hooks). |
67+
| **`hooks`** | Entry point for Hooks. [More details](../hooks/overview#collection-hooks). |
6468
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
6569
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. |
6670
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
@@ -70,11 +74,23 @@ The following options are available:
7074

7175
_\* An asterisk denotes that a property is required._
7276

73-
## Admin Options
77+
### Fields
78+
79+
Fields define the schema of the Documents within a Collection. To learn more, go to the [Fields](../fields/overview) documentation.
80+
81+
### Access Control
82+
83+
Access Control determines what a user can and cannot do with a Document. To learn more, go to the [Access Control](../access-control/overview) docs.
84+
85+
### Hooks
86+
87+
Hooks allow you to tie into the lifecycle of your Documents so you can execute your own logic during specific events. To learn more, go to the [Hooks](../hooks/overview) documentation.
88+
89+
### Admin Options
7490

7591
You can customize the way that the [Admin Panel](../admin/overview) behaves on a Collection-by-Collection basis.
7692

77-
To configure Collection Admin Options, use the `admin` property in your Collection Config:
93+
To configure Admin Options for Collections, use the `admin` property in your Collection Config:
7894

7995
```ts
8096
import { CollectionConfig } from 'payload'
@@ -144,7 +160,7 @@ The preview function receives two arguments:
144160
For fully working example of this, check of the official [Draft Preview Example](https://github.com/payloadcms/payload/tree/main/examples/draft-preview) in the [Examples Directory](https://github.com/payloadcms/payload/tree/main/examples).
145161
</Banner>
146162

147-
### Pagination
163+
#### Pagination
148164

149165
All Collections receive their own List View which displays a paginated list of documents that can be sorted and filtered. The pagination behavior of the List View can be customized on a per-Collection basis.
150166

@@ -173,17 +189,7 @@ The following options are available:
173189
| `defaultLimit` | Integer that specifies the default per-page limit that should be used. Defaults to 10. |
174190
| `limits` | Provide an array of integers to use as per-page options for admins to choose from in the List View. |
175191

176-
### Access Control
177-
178-
You can specify extremely granular access control (what users can do with documents in a Collection) on a Collection by
179-
Collection basis. To learn more, go to the [Access Control](../access-control/overview) docs.
180-
181-
### Hooks
182-
183-
Hooks are a powerful way to extend Collection functionality and execute your own logic, and can be defined on a
184-
Collection by Collection basis. To learn more, go to the [Hooks](../hooks/overview) documentation.
185-
186-
### List Searchable Fields
192+
#### List Searchable Fields
187193

188194
In the List View, there is a "search" box that allows you to quickly find a document through a simple text search. By default, it searches on the ID field. If defined, the `admin.useAsTitle` field is used. Or, you can explicitly define which fields to search based on the needs of your application.
189195

Diff for: docs/configuration/environment-vars.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ SERVER_URL=localhost:3000
2525
DATABASE_URI=mongodb://localhost:27017/my-database
2626
```
2727

28-
To use Environment Variables in your Payload config, you can access them directly from `process.env`:
28+
To use Environment Variables in your Payload Config, you can access them directly from `process.env`:
2929

3030
```ts
3131
import { buildConfig } from 'payload'

Diff for: docs/configuration/globals.mdx

+13-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ desc: Set up your Global config for your needs by defining fields, adding slugs
66
keywords: globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
77
---
88

9-
Globals are in many ways similar to [Collections](../configuration/collections), except they correspond to only a single Document. Globals are perfect for things like header nav, site-wide banner alerts, app-wide localized strings, and other "global" data that your site or app might rely on.
9+
Globals are in many ways similar to [Collections](../configuration/collections), except they correspond to only a single Document. You can define as many Globals as your application needs. Each Global saves to the [Database](../database/overview) based on the [Fields](../fields/overview) that you define.
10+
11+
Globals are the primary way to structure singletons in Payload, such as a header navigation, site-wide banner alerts, or app-wide localized strings. Each Global can have its own unique [Access Control](../access-control/overview), [Hooks](../hooks/overview), [Admin Options](#admin-options), and more.
12+
13+
Globals will automatically generate their own [Local API](../local-api/overview). If your application is using the [Admin Panel](../admin/overview), you will also get a fully-featured [REST API](../rest-api/overview) and [GraphQL API](../graphql/overview) without any additional configuration.
1014

1115
To define a Global Config, use the `globals` property in your [Payload Config](./overview):
1216

@@ -53,7 +57,7 @@ export const Nav: GlobalConfig = {
5357

5458
<Banner type="success">
5559
<strong>Reminder:</strong>
56-
For a more complex example, see the [Public Demo](https://github.com/payloadcms/public-demo) source code on GitHub.
60+
For a more complex example, see the [Public Demo](https://github.com/payloadcms/public-demo) source code on GitHub, or the [Templates](https://github.com/payloadcms/payload/tree/main/templates) and [Examples](https://github.com/payloadcms/payload/tree/main/examples) directories in the Payload repository.
5761
</Banner>
5862

5963
The following options are available:
@@ -68,28 +72,31 @@ The following options are available:
6872
| **`endpoints`** | Add custom routes to the REST API. [More details](../rest-api/overview#custom-endpoints). |
6973
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Global. [Click here](../fields/overview) for a full list of field types as well as how to configure them. |
7074
| **`graphQL.name`** | Text used in schema generation. Auto-generated from slug if not defined. |
71-
| **`hooks`** | Entry points to "tie in" to collection actions at specific points. [More details](../hooks/overview#global-hooks). |
75+
| **`hooks`** | Entry point for Hooks. [More details](../hooks/overview#global-hooks). |
7276
| **`label`** | Text for the name in the Admin Panel or an object with keys for each language. Auto-generated from slug if not defined. |
7377
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Global. |
7478
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
7579
| **`versions`** | Set to true to enable default options, or configure with object properties. [More details](../versions/overview#globals-config). |
7680

7781
_\* An asterisk denotes that a property is required._
7882

83+
### Fields
84+
85+
Fields define the schema of the Global. To learn more, go to the [Fields](../fields/overview) documentation.
7986

8087
### Access Control
8188

82-
As with Collections, you can specify extremely granular access control (what users can do with this Global) on a Global-by-Global basis. However, Globals only have `update` and `read` access control due to their nature of only having one document. To learn more, go to the [Access Control](../access-control/overview) docs.
89+
Access Control determines what a user can and cannot do with a Document. To learn more, go to the [Access Control](../access-control/overview) docs.
8390

8491
### Hooks
8592

86-
Globals also fully support a smaller subset of Hooks. To learn more, go to the [Hooks](../hooks/overview) documentation.
93+
Hooks allow you to tie into the lifecycle of your Documents so you can execute your own logic during specific events. To learn more, go to the [Hooks](../hooks/overview) documentation.
8794

8895
### Admin Options
8996

9097
You can customize the way that the [Admin Panel](../admin/overview) behaves on a Global-by-Global basis.
9198

92-
To configure Collection Admin Options, use the `admin` property in your Global Config:
99+
To configure Admin Options for Globals, use the `admin` property in your Global Config:
93100

94101
```ts
95102
import { GlobalConfig } from 'payload'

Diff for: docs/configuration/i18n.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const Articles: CollectionConfig = {
135135

136136
Payload's backend sets the language on incoming requests before they are handled. This allows backend validation to return error messages in the user's own language or system generated emails to be sent using the correct translation. You can make HTTP requests with the `accept-language` header and Payload will use that language.
137137

138-
Anywhere in your Payload app that you have access to the `req` object, you can access payload's extensive internationalization features assigned to `req.i18n`. To access text translations you can use `req.t('namespace:key')`.
138+
Anywhere in your Payload app that you have access to the `req` object, you can access Payload's extensive internationalization features assigned to `req.i18n`. To access text translations you can use `req.t('namespace:key')`.
139139

140140
## TypeScript
141141

@@ -169,7 +169,7 @@ export const MyComponent: React.FC = () => {
169169

170170
```
171171

172-
Additionally, payload exposes the `t` function in various places, for example in labels. Here is how you would type those:
172+
Additionally, Payload exposes the `t` function in various places, for example in labels. Here is how you would type those:
173173

174174
```ts
175175
import type {

0 commit comments

Comments
 (0)