Folders
Folders allow you to group documents across collections, and are a great way to organize your content. Folders are built on top of relationship fields, when you enable folders on a collection, Payload adds a hidden relationship field folders
, that relates to a folder — or no folder. Folders also have the folder
field, allowing folders to be nested within other folders.
The configuration for folders is done in two places, the collection config and the Payload config. The collection config is where you enable folders, and the Payload config is where you configure the global folder settings.
Folder Configuration
On the payload config, you can configure the following settings under the folders
property:
Collection Configuration
To enable folders on a collection, you need to set the admin.folders
property to true
on the collection config. This will add a hidden relationship field to the collection that relates to a folder — or no folder.