Nested Docs
Adds parent-child document hierarchies with auto-generated breadcrumbs to Payload collections.
Installation
pnpm add @payloadcms/plugin-nested-docs About
The Nested Docs plugin turns any Payload collection into a page tree. Pick the collection slugs you want to extend and the plugin attaches a `parent` relationship field (placed in the sidebar) and a `breadcrumbs` array field to each one. Editors pick a parent document, and the plugin walks the chain to build and store a breadcrumb trail on every doc. Breadcrumbs are populated in a `beforeChange` hook and written back to the document, so the hierarchy is queryable at read time rather than reconstructed on the fly. An `afterChange` hook resaves child documents when a parent moves, keeping descendant URLs and labels in sync. The parent field's `filterOptions` excludes the current doc and any of its ancestors, which prevents reference cycles. The breadcrumbs field is localized and read-only in the admin UI. Each entry stores a relationship to its document plus a generated `url` and `label`. Both are produced through optional `generateURL` and `generateLabel` functions that receive the full ancestor chain, the current doc, the collection config, and the request, so you control URL and label formatting per project. Configuration is minimal: pass the target `collections` array, and optionally override the `parentFieldSlug` and `breadcrumbsFieldSlug` if your collections already define fields with those names. The plugin can be registered more than once with different collection sets when you need separate trees. It targets Payload 4 (currently published as a beta) and exports a `getParents` helper for fetching the ancestor chain outside the admin context.
Package info
- Package name
@payloadcms/plugin-nested-docs- Latest version
3.85.2- Unpacked size
- 51 kB
- License
- MIT
- Weekly downloads
- 70.7k
- Last publish
- Jul 1, 2026
More from payloadcms
View profileCloud Storage
This plugin integrates cloud storage options into Payload CMS.
Zapier
Sends Zapier webhook events when Payload collection documents are created, updated, or deleted.
Cloud
Connects a Payload instance to Payload Cloud's managed S3 storage, Cloudflare CDN upload caching, and Resend email delivery.
Form Builder
Official Payload plugin that lets admins build forms, collect submissions, send templated emails, and optionally process payments or uploads.
Stripe
Syncs Payload collections with Stripe resources and routes Stripe webhooks and API calls through Payload.
Search plugin
Search plugin for Payload enables fast searching of document records.
Similar plugins
More in ContentIframe Tabs
Add iframes into separate tabs in the Payload admin panel.
Relationship Enhancer
Enhances relationships in Payload CMS with referential integrity and bi-directional support.
Comment
Adds a customizable Comments collection to Payload CMS for user feedback.
Visual Editor
Adds a visual live editor to Payload CMS for instant content preview.
Author Fields
Adds created and updated by fields to collections and globals in Payload CMS.
create api docs
Generate OpenAPI 3 documentation for Payload CMS.