Extends Payload's built-in folders so folders define URL structure and slugs are generated from the folder path plus a page segment. The plugin adds folder, pageSegment, sortOrder and slugHistory fields to collections such as pages and posts, and registers a tree view in the admin. Collections need a plain text slug field, and Payload 3 or later is required.
Payload CMS plugin for folder-based hierarchical URL slugs with visual tree management
Installation
npm i @delmaredigital/payload-page-tree19
Stars
2
Forks
0
Open Issues
3 weeks ago
Last Updated
536
Weekly Downloads
v0.4.1
npm Version
328.8 KB
Unpacked Size
2
Dependencies
190 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 19 |
| Dec 5, 2026 | 19 |
| Dec 4, 2026 | 19 |
| Dec 3, 2026 | 19 |
| Dec 2, 2026 | 19 |
| Dec 1, 2026 | 19 |
| Nov 30, 2026 | 19 |
| Nov 29, 2026 | 19 |
| Nov 28, 2026 | 19 |
| Nov 27, 2026 | 19 |
| Nov 26, 2026 | 19 |
| Nov 25, 2026 | 19 |
| Nov 24, 2026 | 19 |
| Nov 23, 2026 | 19 |
| Nov 22, 2026 | 19 |
| Nov 21, 2026 | 19 |
| Nov 20, 2026 | 19 |
| Nov 19, 2026 | 19 |
| Nov 18, 2026 | 19 |
| Nov 17, 2026 | 19 |
| Nov 16, 2026 | 19 |
| Nov 15, 2026 | 19 |
| Nov 14, 2026 | 19 |
| Nov 13, 2026 | 19 |
| Nov 12, 2026 | 19 |
| Nov 11, 2026 | 19 |
| Nov 10, 2026 | 19 |
| Nov 9, 2026 | 19 |
| Nov 8, 2026 | 19 |
| Nov 7, 2026 | 19 |
| Nov 6, 2026 | 19 |
| Nov 5, 2026 | 19 |
| Nov 4, 2026 | 19 |
| Nov 3, 2026 | 19 |
| Nov 2, 2026 | 19 |
| Nov 1, 2026 | 19 |
| Oct 31, 2026 | 19 |
| Oct 30, 2026 | 19 |
| Oct 29, 2026 | 19 |
| Oct 28, 2026 | 19 |
| Oct 27, 2026 | 19 |
| Oct 26, 2026 | 19 |
| Oct 25, 2026 | 19 |
| Oct 24, 2026 | 19 |
| Oct 23, 2026 | 19 |
| Oct 22, 2026 | 19 |
| Oct 21, 2026 | 19 |
| Oct 20, 2026 | 19 |
| Oct 19, 2026 | 19 |
| Oct 18, 2026 | 19 |
| Oct 17, 2026 | 19 |
| Oct 16, 2026 | 19 |
| Oct 15, 2026 | 19 |
| Oct 14, 2026 | 19 |
| Oct 13, 2026 | 19 |
| Oct 12, 2026 | 19 |
| Oct 11, 2026 | 19 |
| Oct 10, 2026 | 19 |
| Oct 9, 2026 | 19 |
| Oct 8, 2026 | 19 |
| Oct 7, 2026 | 19 |
| Oct 6, 2026 | 19 |
| Oct 5, 2026 | 19 |
| Oct 4, 2026 | 19 |
| Oct 3, 2026 | 19 |
| Oct 2, 2026 | 19 |
| Oct 1, 2026 | 19 |
| Sep 30, 2026 | 19 |
| Sep 29, 2026 | 19 |
| Sep 28, 2026 | 19 |
| Sep 27, 2026 | 19 |
| Sep 26, 2026 | 19 |
| Sep 25, 2026 | 19 |
| Sep 24, 2026 | 19 |
| Sep 23, 2026 | 19 |
| Sep 22, 2026 | 19 |
| Sep 21, 2026 | 19 |
| Sep 20, 2026 | 19 |
| Sep 19, 2026 | 19 |
| Sep 18, 2026 | 19 |
| Sep 17, 2026 | 19 |
| Sep 16, 2026 | 19 |
| Sep 15, 2026 | 19 |
| Sep 14, 2026 | 19 |
| Sep 13, 2026 | 19 |
| Sep 12, 2026 | 19 |
| Sep 11, 2026 | 19 |
| Sep 10, 2026 | 19 |
| Sep 9, 2026 | 19 |
| Sep 8, 2026 | 19 |
| Sep 7, 2026 | 19 |
429−140 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 429 |
| Dec 5, 2026 | 393 |
| Dec 4, 2026 | 350 |
| Dec 3, 2026 | 337 |
| Dec 2, 2026 | 259 |
| Dec 1, 2026 | 214 |
| Nov 30, 2026 | 239 |
| Nov 29, 2026 | 298 |
| Nov 28, 2026 | 315 |
| Nov 27, 2026 | 350 |
| Nov 26, 2026 | 441 |
| Nov 25, 2026 | 475 |
| Nov 24, 2026 | 515 |
| Nov 23, 2026 | 521 |
| Nov 22, 2026 | 535 |
| Nov 21, 2026 | 531 |
| Nov 20, 2026 | 592 |
| Nov 19, 2026 | 539 |
| Nov 18, 2026 | 792 |
| Nov 17, 2026 | 797 |
| Nov 16, 2026 | 971 |
| Nov 15, 2026 | 910 |
| Nov 14, 2026 | 937 |
| Nov 13, 2026 | 867 |
| Nov 12, 2026 | 899 |
| Nov 11, 2026 | 577 |
| Nov 10, 2026 | 550 |
| Nov 9, 2026 | 354 |
| Nov 8, 2026 | 377 |
| Nov 7, 2026 | 408 |
| Nov 6, 2026 | 443 |
| Nov 5, 2026 | 473 |
| Nov 4, 2026 | 562 |
| Nov 3, 2026 | 609 |
| Nov 2, 2026 | 672 |
| Nov 1, 2026 | 692 |
| Oct 31, 2026 | 642 |
| Oct 30, 2026 | 574 |
| Oct 29, 2026 | 435 |
| Oct 28, 2026 | 310 |
| Oct 27, 2026 | 378 |
| Oct 26, 2026 | 423 |
| Oct 25, 2026 | 375 |
| Oct 24, 2026 | 504 |
| Oct 23, 2026 | 482 |
| Oct 22, 2026 | 540 |
| Oct 21, 2026 | 645 |
| Oct 20, 2026 | 531 |
| Oct 19, 2026 | 446 |
| Oct 18, 2026 | 447 |
| Oct 17, 2026 | 378 |
| Oct 16, 2026 | 446 |
| Oct 15, 2026 | 476 |
| Oct 14, 2026 | 457 |
| Oct 13, 2026 | 458 |
| Oct 12, 2026 | 459 |
| Oct 11, 2026 | 464 |
| Oct 10, 2026 | 439 |
| Oct 9, 2026 | 408 |
| Oct 8, 2026 | 371 |
| Oct 7, 2026 | 317 |
| Oct 6, 2026 | 296 |
| Oct 5, 2026 | 280 |
| Oct 4, 2026 | 299 |
| Oct 3, 2026 | 325 |
| Oct 2, 2026 | 365 |
| Oct 1, 2026 | 399 |
| Sep 30, 2026 | 632 |
| Sep 29, 2026 | 636 |
| Sep 28, 2026 | 656 |
| Sep 27, 2026 | 638 |
| Sep 26, 2026 | 573 |
| Sep 25, 2026 | 563 |
| Sep 24, 2026 | 529 |
| Sep 23, 2026 | 345 |
| Sep 22, 2026 | 349 |
| Sep 21, 2026 | 360 |
| Sep 20, 2026 | 463 |
| Sep 19, 2026 | 524 |
| Sep 18, 2026 | 753 |
| Sep 17, 2026 | 777 |
| Sep 16, 2026 | 732 |
| Sep 15, 2026 | 728 |
| Sep 14, 2026 | 688 |
| Sep 13, 2026 | 635 |
| Sep 12, 2026 | 621 |
| Sep 11, 2026 | 455 |
| Sep 10, 2026 | 564 |
| Sep 9, 2026 | 564 |
| Sep 8, 2026 | 557 |
| Sep 7, 2026 | 569 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1131676452-root)<a href="https://payloaddirectory.dev/plugins/1131676452-root"><img src="https://payloaddirectory.dev/badge/1131676452-root.svg" alt="Payload Directory"></a>README
A Payload CMS plugin that extends the built-in folders feature to auto-generate hierarchical URL slugs. Folders define URL structure, pages pick a folder, and slugs are auto-generated.
Documentation: plugins.delmaredigital.com/docs/page-tree · Overview
pnpm add @delmaredigital/payload-page-tree
// src/payload.config.ts
import { buildConfig } from 'payload'
import { pageTreePlugin } from '@delmaredigital/payload-page-tree'
import { Pages } from './collections/Pages'
export default buildConfig({
collections: [Pages],
plugins: [
pageTreePlugin(), // Auto-detects 'pages' and 'posts' if they exist
],
})
Your collections must have a slug field. The plugin makes it read-only and auto-generates values from folder path + page segment.
// src/collections/Pages/index.ts
import type { CollectionConfig } from 'payload'
export const Pages: CollectionConfig = {
slug: 'pages',
fields: [
{ name: 'title', type: 'text', required: true },
{
name: 'slug',
type: 'text',
required: true,
unique: true,
index: true,
},
],
}
Important: Do NOT use Payload's
slugField()helper. Use a plain text field — the plugin manages slugs via its own hooks.
// app/[...slug]/page.tsx
export default async function Page({ params }: { params: { slug: string[] } }) {
const fullSlug = params.slug.join('/')
const { docs } = await payload.find({
collection: 'pages',
where: { slug: { equals: fullSlug } },
limit: 1,
})
// ...
}
That's it! The plugin adds folder, pageSegment, sortOrder, and slugHistory fields automatically, and registers the tree view at /admin/page-tree.
The tree view calls fourteen endpoints under /api/page-tree/*. Two layers decide who may use them:
access option runs before every endpoint. By default it requires an authenticated Payload user (401 without a user, 403 when denied).overrideAccess: false as the requesting user, so the access rules on your page and folder collections are enforced. URL maintenance (slug ancestry, collision checks, cascade inventories) reads with trusted access, but only beneath folders the user can read. See access control for the details.pageTreePlugin({
// Only admins may use the tree endpoints
access: ({ req }) => req.user?.role === 'admin',
})
Upgrading from 0.3.16 or earlier: those versions registered the endpoints with no authentication and bypassed collection access rules. Upgrade, and review the
accessrules on your page and folder collections — they now govern the tree. See the CHANGELOG.
MIT
nested docs
Official plugin for nesting Payload documents inside one another
100151.9k/wk46.1kv3 v4
path
Stored, indexed URL paths for Payload 4 pages and posts built from a parent and a slug
75270/wk10v4
payload slug redirects
Records slug changes in Payload and redirects old URLs to the current slug in Next.js
6471/wk3v3
paths
Stored, queryable document paths for Payload page trees with publish-time uniqueness and a framework-agnostic resolver
60164/wk16v3
payload slug
Slug field with Auto/Manual modes, nested source paths, localization and enforced uniqueness
802.4k/wk0v3
localized slugs
Copies localized slug and full path values into a per-locale localizedSlugs field for multi-language Payload sites
7881/wk9v3