Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/access-control/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const FieldWithAccessControl: Field = {
```

<Banner type="warning">
**Note:** Field Access Controls does not support returning
**Note:** Field Access Control does not support returning
[Query](../queries/overview) constraints like [Collection Access
Control](./collections) does.
</Banner>
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Every page within the Admin Panel automatically receives dynamic, auto-generated

Metadata is fully configurable at the root level and cascades down to individual collections, documents, and custom views. This allows for the ability to control metadata on any page with high precision, while also providing sensible defaults.

All metadata is injected into Next.js' [`generateMetadata`](https://nextjs.org/docs/app/api-reference/functions/generate-metadata) function. This used to generate the `<head>` of pages within the Admin Panel. All metadata options that are available in Next.js are exposed by Payload.
All metadata is injected into Next.js' [`generateMetadata`](https://nextjs.org/docs/app/api-reference/functions/generate-metadata) function. This is used to generate the `<head>` of pages within the Admin Panel. All metadata options that are available in Next.js are exposed by Payload.

Within the Admin Panel, metadata can be customized at the following levels:

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ app

As shown above, all Payload routes are nested within the `(payload)` route group. This creates a boundary between the Admin Panel and the rest of your application by scoping all layouts and styles. The `layout.tsx` file within this directory, for example, is where Payload manages the `html` tag of the document to set proper [`lang`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) and [`dir`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir) attributes, etc.

The `admin` directory contains all the _pages_ related to the interface itself, whereas the `api` and `graphql` directories contains all the _routes_ related to the [REST API](../rest-api/overview) and [GraphQL API](../graphql/overview). All admin routes are [easily configurable](#customizing-routes) to meet your application's exact requirements.
The `admin` directory contains all the _pages_ related to the interface itself, whereas the `api` and `graphql` directories contain all the _routes_ related to the [REST API](../rest-api/overview) and [GraphQL API](../graphql/overview). All admin routes are [easily configurable](#customizing-routes) to meet your application's exact requirements.

<Banner type="warning">
**Note:** If you don't intend to use the Admin Panel, [REST
Expand Down
4 changes: 2 additions & 2 deletions docs/admin/preview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The `options` object contains the following properties:
| ------------ | ----------------------------------------------------- |
| **`locale`** | The current locale of the Document being edited. |
| **`req`** | The Payload Request object. |
| **`token`** | The JWT token of the currently authenticated in user. |
| **`token`** | The JWT token of the currently authenticated user. |

If your application requires a fully qualified URL, such as within deploying to Vercel Preview Deployments, you can use the `req` property to build this URL:

Expand Down Expand Up @@ -225,7 +225,7 @@ export default async function Page({ params: paramsPromise }) {
```

<Banner type="success">
**Note:** For fully working example of this, check of the official [Draft
**Note:** For fully working example of this, check out the official [Draft
Preview
Example](https://github.com/payloadcms/payload/tree/main/examples/draft-preview)
in the [Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/email.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Authentication Emails
label: Email Verification
order: 30
desc: Email Verification allows users to verify their email address before they're account is fully activated. Email Verification ties directly into the Email functionality that Payload provides.
desc: Email Verification allows users to verify their email address before their account is fully activated. Email Verification ties directly into the Email functionality that Payload provides.
keywords: authentication, email, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---

Expand Down
2 changes: 1 addition & 1 deletion docs/custom-components/document-views.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ desc:
keywords:
---

Document Views consist of multiple, individual views that together represent any single [Collection](../configuration/collections) or [Global](../configuration/globals) Document. All Document Views and are scoped under the `/collections/:collectionSlug/:id` or the `/globals/:globalSlug` route, respectively.
Document Views consist of multiple, individual views that together represent any single [Collection](../configuration/collections) or [Global](../configuration/globals) Document. All Document Views are scoped under the `/collections/:collectionSlug/:id` or the `/globals/:globalSlug` route, respectively.

There are a number of default Document Views, such as the [Edit View](./edit-view) and API View, but you can also create [entirely new views](./custom-views#adding-new-views) as needed. All Document Views share a layout and can be given their own tab-based navigation, if desired.

Expand Down
8 changes: 4 additions & 4 deletions docs/custom-components/edit-view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ desc:
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---

The Edit View is where users interact with individual [Collection](../configuration/collections) and [Global](../configuration/globals) Documents within the [Admin Panel](../admin/overview). The Edit View contains the actual form in which submits the data to the server. This is where they can view, edit, and save their content. It contains controls for saving, publishing, and previewing the document, all of which can be customized to a high degree.
The Edit View is where users interact with individual [Collection](../configuration/collections) and [Global](../configuration/globals) Documents within the [Admin Panel](../admin/overview). The Edit View contains the actual form that submits the data to the server. This is where they can view, edit, and save their content. It contains controls for saving, publishing, and previewing the document, all of which can be customized to a high degree.

The Edit View can be swapped out in its entirety for a Custom View, or it can be injected with a number of Custom Components to add additional functionality or presentational elements without replacing the entire view.

<Banner type="warning">
**Note:** The Edit View is one of many [Document Views](./document-views) in
the Payload Admin Panel. Each Document View is responsible for a different
aspect of the interacting with a single Document.
aspect of interacting with a single Document.
</Banner>

## Custom Edit View
Expand Down Expand Up @@ -74,7 +74,7 @@ In addition to swapping out the entire Edit View with a [Custom View](./custom-v

<Banner type="warning">
**Important:** Collection and Globals are keyed to a different property in the
`admin.components` object have slightly different options. Be sure to use the
`admin.components` object and have slightly different options. Be sure to use the
correct key for the entity you are working with.
</Banner>

Expand Down Expand Up @@ -199,7 +199,7 @@ export function MySaveButton(props: SaveButtonClientProps) {

The `beforeDocumentControls` property allows you to render custom components just before the default document action buttons (like Save, Publish, or Preview). This is useful for injecting custom buttons, status indicators, or any other UI elements before the built-in controls.

To add `beforeDocumentControls` components, use the `components.edit.beforeDocumentControls` property in you [Collection Config](../configuration/collections) or `components.elements.beforeDocumentControls` in your [Global Config](../configuration/globals):
To add `beforeDocumentControls` components, use the `components.edit.beforeDocumentControls` property in your [Collection Config](../configuration/collections) or `components.elements.beforeDocumentControls` in your [Global Config](../configuration/globals):

#### Collections

Expand Down
2 changes: 1 addition & 1 deletion docs/custom-components/root-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following options are available:
_For details on how to build Custom Components, see [Building Custom Components](./overview#building-custom-components)._

<Banner type="success">
**Note:** You can also use set [Collection
**Note:** You can also set [Collection
Components](../configuration/collections#custom-components) and [Global
Components](../configuration/globals#custom-components) in their respective
configs.
Expand Down
2 changes: 1 addition & 1 deletion docs/database/mongodb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ export default buildConfig({
We export compatibility options for [DocumentDB](https://aws.amazon.com/documentdb/), [Azure Cosmos DB](https://azure.microsoft.com/en-us/products/cosmos-db) and [Firestore](https://cloud.google.com/firestore/mongodb-compatibility/docs/overview). Known limitations:

- Azure Cosmos DB does not support transactions that update two or more documents in different collections, which is a common case when using Payload (via hooks).
- Azure Cosmos DB the root config property `indexSortableFields` must be set to `true`.
- Azure Cosmos DB requires the root config property `indexSortableFields` to be set to `true`.
2 changes: 1 addition & 1 deletion docs/database/postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default buildConfig({
```

<Banner type="info">
**Note:** If you're using `vercelPostgresAdapter` your
**Note:** If you're using `vercelPostgresAdapter` and your
`process.env.POSTGRES_URL` or `pool.connectionString` points to a local
database (e.g hostname has `localhost` or `127.0.0.1`) we use the `pg` module
for pooling instead of `@vercel/postgres`. This is because `@vercel/postgres`
Expand Down
2 changes: 1 addition & 1 deletion docs/ecommerce/advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can import the collections directly from the plugin and add them to your Pay
| `createAddressesCollection` | `addresses` | Used for customer addresses (like shipping and billing). [More](#createAddressesCollection) |
| `createCartsCollection` | `carts` | Carts can be used by customers, guests and once purchased are kept for records and analytics. [More](#createCartsCollection) |
| `createOrdersCollection` | `orders` | Orders are used to store customer-side information and are related to at least one transaction. [More](#createOrdersCollection) |
| `createTransactionsCollection` | `transactions` | Handles payment information accessable by admins only, related to Orders. [More](#createTransactionsCollection) |
| `createTransactionsCollection` | `transactions` | Handles payment information accessible by admins only, related to Orders. [More](#createTransactionsCollection) |
| `createProductsCollection` | `products` | All the product information lives here, contains prices, relations to Variant Types and joins to Variants. [More](#createProductsCollection) |
| `createVariantsCollection` | `variants` | Product variants, unique purchasable items that are linked to a product and Variant Options. [More](#createVariantsCollection) |
| `createVariantTypesCollection` | `variantTypes` | A taxonomy used by Products to relate Variant Options together. An example of a Variant Type is "size". [More](#createVariantTypesCollection) |
Expand Down
2 changes: 1 addition & 1 deletion docs/ecommerce/frontend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following hooks and components are available:
| ------------------- | ------------------------------------------------------------------------------ |
| `EcommerceProvider` | A context provider to wrap your application and provide the ecommerce context. |
| `useCart` | A hook to manage the cart state and actions. |
| `useAddresses` | A hook to fetch and manage products. |
| `useAddresses` | A hook to fetch and manage addresses. |
| `usePayments` | A hook to manage the checkout process. |
| `useCurrency` | A hook to format prices based on the selected currency. |
| `useEcommerce` | A hook that encompasses all of the above in one. |
Expand Down
4 changes: 2 additions & 2 deletions docs/ecommerce/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ keywords: plugins, ecommerce, stripe, plugin, payload, cms, shop, payments
releases.
</Banner>

Payload provides an Ecommerce Plugin that allows you to add ecommerce functionality to your app. It comes a set of utilities and collections to manage products, orders, and payments. It also integrates with popular payment gateways like Stripe to handle transactions.
Payload provides an Ecommerce Plugin that allows you to add ecommerce functionality to your app. It comes with a set of utilities and collections to manage products, orders, and payments. It also integrates with popular payment gateways like Stripe to handle transactions.

<Banner type="info">
This plugin is completely open-source and the [source code can be found
Expand Down Expand Up @@ -97,7 +97,7 @@ Each Variant Type can contain a set of Variant Options. For example, a T-Shirt p

**Carts**

Carts are linked to Customers or they're left entirely public for guests users and can contain multiple Products and Variants. Carts are stored in the database and can be retrieved at any time. Carts are automatically created for Customers when they add a product to their cart for the first time.
Carts are linked to Customers or they're left entirely public for guest users and can contain multiple Products and Variants. Carts are stored in the database and can be retrieved at any time. Carts are automatically created for Customers when they add a product to their cart for the first time.

**Transactions and Orders**

Expand Down
6 changes: 3 additions & 3 deletions docs/ecommerce/payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ The arguments can be extended but should always include the `PaymentAdapterArgs`

| Property | Type | Description |
| ---------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `label` | `string` | (Optional) Allow overriding the default UI label for this adaper. |
| `label` | `string` | (Optional) Allow overriding the default UI label for this adapter. |
| `groupOverrides` | `FieldsOverride` | (Optional) Allow overriding the default fields of the payment group. See [Payment Fields](#payment-fields) for more details. |

#### initiatePayment

The `initiatePayment` function is called when a payment is initiated. At this step the transaction is created with a status "Processing", an abandoned purchaase will leave this transaction in this state. It receives an object with the following properties:
The `initiatePayment` function is called when a payment is initiated. At this step the transaction is created with a status "Processing", an abandoned purchase will leave this transaction in this state. It receives an object with the following properties:

| Property | Type | Description |
| ------------------ | ---------------- | --------------------------------------------- |
Expand Down Expand Up @@ -407,7 +407,7 @@ And for the args use the `PaymentAdapterClientArgs` type:

| Property | Type | Description |
| -------- | -------- | ----------------------------------------------------------------- |
| `label` | `string` | (Optional) Allow overriding the default UI label for this adaper. |
| `label` | `string` | (Optional) Allow overriding the default UI label for this adapter. |

## Best Practices

Expand Down
35 changes: 34 additions & 1 deletion docs/fields/group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const ExampleCollection: CollectionConfig = {

## Presentational group fields

You can also use the Group field to only visually group fields without affecting the data structure. Not defining a label will render just the grouped fields.
You can also use the Group field to only visually group fields without affecting the data structure. Not defining a `name` will render just the grouped fields (no nested object is created). If you want the group to appear as a titled section in the Admin UI, set a `label`.

```ts
import type { CollectionConfig } from 'payload'
Expand All @@ -120,6 +120,39 @@ export const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
fields: [
{
label: 'Page meta', // label only → presentational
type: 'group', // required
fields: [
{
name: 'title',
type: 'text',
required: true,
minLength: 20,
maxLength: 100,
},
{
name: 'description',
type: 'textarea',
required: true,
minLength: 40,
maxLength: 160,
},
],
},
],
}
```

## Named group

```ts
import type { CollectionConfig } from 'payload'

export const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
fields: [
{
name: 'pageMeta', // name → nested object in data
label: 'Page meta',
type: 'group', // required
fields: [
Expand Down
2 changes: 1 addition & 1 deletion docs/fields/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Here are the available Presentational Fields:
- [Collapsible](../fields/collapsible) - nests fields within a collapsible component
- [Row](../fields/row) - aligns fields horizontally
- [Tabs (Unnamed)](../fields/tabs) - nests fields within a tabbed layout. It is not presentational if the tab has a name.
- [Group (Unnamed)](../fields/group) - nests fields within a keyed object It is not presentational if the group has a name.
- [Group (Unnamed)](../fields/group) - nests fields within a keyed object. It is not presentational if the group has a name.
- [UI](../fields/ui) - blank field for custom UI components

### Virtual Fields
Expand Down
2 changes: 1 addition & 1 deletion docs/hooks/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const FieldWithHooks: Field = {

## Config Options

All Field Hooks accept an array of synchronous or asynchronous functions. These functions can optionally modify the return value of the field before the operation continues. All Field Hooks are formatted to accept the same arguments, although some arguments may be `undefined` based the specific hook type.
All Field Hooks accept an array of synchronous or asynchronous functions. These functions can optionally modify the return value of the field before the operation continues. All Field Hooks are formatted to accept the same arguments, although some arguments may be `undefined` based on the specific hook type.

<Banner type="warning">
**Important:** Due to GraphQL's typed nature, changing the type of data that
Expand Down
2 changes: 1 addition & 1 deletion docs/hooks/globals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const afterReadHook: GlobalAfterReadHook = async ({
}) => {...}
```

The following arguments are provided to the `beforeRead` hook:
The following arguments are provided to the `afterRead` hook:

| Option | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
Loading
Loading