diff --git a/99 Daily/2026-05-15.md b/99 Daily/2026-05-15.md index 55fd9a1..5103da1 100644 --- a/99 Daily/2026-05-15.md +++ b/99 Daily/2026-05-15.md @@ -76,3 +76,4 @@ tags: [daily] - 15:31 — session ended | `ai_leed` - 15:33 — session ended | `ai_leed` - 15:38 — session ended | `ai_leed` +- 15:42 — session ended | `ai_leed` diff --git a/raw/folders__overview.md b/raw/_processed/folders__overview.md similarity index 100% rename from raw/folders__overview.md rename to raw/_processed/folders__overview.md diff --git a/wiki/_master-index.md b/wiki/_master-index.md index 8d993d3..8182b7e 100644 --- a/wiki/_master-index.md +++ b/wiki/_master-index.md @@ -35,7 +35,7 @@ This 3-hop pattern works for hundreds of articles without vector search. | [[wiki/reports/_index\|reports/]] | Weekly and monthly summaries — generate: `uv run python scripts/report-generator.py --weekly` | 1 | | [[wiki/infrastructure/_index\|infrastructure/]] | Server inventory: all 10 SSH hosts — optical, optical-dev, optical-prod, baic, librechat, modocmms, box-cli, aimpress, pve | 12 | | [[wiki/testing/_index\|testing/]] | Web app testing: functional, performance, security, UI types; TDD/BDD/Agile methodologies; Selenium/Cypress/Playwright/JMeter/OWASP ZAP tools | 1 | -| [[wiki/payloadcms/_index\|payloadcms/]] | Full Payload CMS reference — getting started, config, database (Postgres/MongoDB/SQLite), all 22 field types, access control, hooks, authentication (cookies, JWT, API keys, custom strategies, token data), admin UI, custom components, Lexical rich text, live preview, versions/drafts, Local/REST/GraphQL APIs, queries, plugins, jobs queue, upload, ecommerce, production deploy, TypeScript, migration guides, i18n, localization | 85 | +| [[wiki/payloadcms/_index\|payloadcms/]] | Full Payload CMS reference — getting started, config, database (Postgres/MongoDB/SQLite), all 22 field types, access control, hooks, authentication (cookies, JWT, API keys, custom strategies, token data), admin UI, custom components, Lexical rich text, live preview, versions/drafts, Local/REST/GraphQL APIs, queries, plugins, jobs queue, upload, ecommerce, production deploy, TypeScript, migration guides, i18n, localization | 86 | | [[wiki/shared-patterns/_index\|shared-patterns/]] | Oliver Agency standard library patterns: httpx, structlog, pydantic-settings, alembic — reuse before writing from scratch | 4 | | [[wiki/mistakes/_index\|mistakes/]] | Anti-patterns extracted from sessions — per-stack running lists (fastapi, react, docker, postgres, general) — injected at session start | 5 | diff --git a/wiki/payloadcms/_index.md b/wiki/payloadcms/_index.md index 6b72c9a..525bfc1 100644 --- a/wiki/payloadcms/_index.md +++ b/wiki/payloadcms/_index.md @@ -13,6 +13,7 @@ | [[wiki/payloadcms/upload\|Upload & Media]] | Upload config, imageSizes, focal point, storage adapters (S3/R2/GCS/Azure/Vercel Blob), access control, gotchas | raw/upload__*.md | 2026-05-15 | | [[wiki/payloadcms/features\|Features — Email, Folders, Trash, Query Presets]] | Email adapters (Nodemailer/Resend), folder grouping (beta), soft-delete trash workflow, saved query presets | raw/email/folders/trash/query-presets | 2026-05-15 | +| [[wiki/payloadcms/folders\|Folders — Content Organization]] | Folder grouping for collections (beta): global config, per-collection opt-in, nesting, browse-by-folder view | raw/folders__overview.md | 2026-05-15 | | [[wiki/payloadcms/email\|Email — Adapters, SMTP, Resend, Attachments]] | Full email reference: Nodemailer (SMTP/SendGrid/dev), Resend (serverless), sendEmail API, attachments (Buffer/path/Base64/URL), media collection attachments | raw/email__overview.md | 2026-05-15 | | [[wiki/payloadcms/local-api\|Local API]] | Direct DB access via `payload.*` — CRUD, auth ops, globals, server functions, access control, outside Next.js | raw/local-api__*.md | 2026-05-15 | | [[wiki/payloadcms/rest-api\|REST API]] | Auto-generated HTTP endpoints, all query params, auth routes, SDK, custom endpoints, method override | raw/rest-api__overview.md | 2026-05-15 | diff --git a/wiki/payloadcms/folders.md b/wiki/payloadcms/folders.md new file mode 100644 index 0000000..62717f7 --- /dev/null +++ b/wiki/payloadcms/folders.md @@ -0,0 +1,82 @@ +--- +title: "Folders — Content Organization" +aliases: [payload-folders, payload-content-folders] +tags: [payloadcms, folders, organization, collections, beta] +sources: [raw/folders__overview.md] +created: 2026-05-15 +updated: 2026-05-15 +--- + +## Overview + +Folders let you group documents across collections. Built on top of [[wiki/payloadcms/fields|relationship fields]] — enabling a folder adds a hidden `folder` relationship field to each document. Folders can nest within other folders. + +> **Beta warning:** Folders feature is in beta and may change in minor versions before stable. + +## Configuration + +Two config locations: global (`payload.config.ts`) and per-collection. + +### Global (payload config) + +```ts +import { buildConfig } from 'payload' + +const config = buildConfig({ + folders: { + browseByFolder: true, // default: true — enables browse-by-folder view + debug: false, // default: false — shows hidden folder fields/collections + fieldName: 'folder', // default: 'folder' — hidden field name on documents + slug: 'payload-folders', // default: 'payload-folders' — internal collection slug + collectionOverrides: [ // optional — plugins can mutate the folder collection + async ({ collection }) => collection, + ], + }, +}) +``` + +### Per-Collection + +```ts +{ + slug: 'pages', + folders: true, // simplest form — defaults to false +} + +// Or with options: +{ + slug: 'pages', + folders: { + browseByFolder: true, // include this collection in browse-by-folder view + }, +} +``` + +`folders: true` adds a hidden relationship field pointing to the folder collection (or `null` = no folder). + +## How It Works + +- Payload creates an internal `payload-folders` collection (slug configurable) +- Each folder document has its own `folder` field → enables nesting +- Collections opt-in via `folders: true` — no effect on others +- The hidden field name defaults to `folder` but is configurable via `fieldName` + +## Key Takeaways + +- **Opt-in per collection** — set `folders: true` in collection config; off by default +- **Nested folders** — folders themselves have a `folder` field, so trees are supported +- **Browse view** — `browseByFolder: true` enables a dedicated browse UI in the admin panel +- **Debug mode** — `debug: true` surfaces the hidden folder fields/collections in the UI (useful during development) +- **Slug override** — if `payload-folders` conflicts with existing collections, override via `slug` +- **Beta** — API/config shape may change before stable; pin minor versions if upgrading + +## Related + +- [[wiki/payloadcms/features|Features — Email, Folders, Trash, Query Presets]] +- [[wiki/payloadcms/fields|Field Types Reference]] +- [[wiki/payloadcms/admin-panel-overview|Admin Panel Overview]] +- [[wiki/payloadcms/queries|Queries — Where, Sort, Pagination]] + +## Sources + +- `raw/folders__overview.md` — https://payloadcms.com/docs/folders/overview