enhancement: One category tree for events and posts, a default image per category, and credit on media
Back to our planProblem
Events and posts are sorted with two different category systems. Posts use the categories collection, which already supports parent and child categories through the nested-docs plugin. Events use a fixed select list (EVENT_CATEGORIES: meeting, social, volunteer, workshop, sports, community, other) with no subcategories. So editors manage two lists, residents can't filter events and posts the same way, and the intelligence agents (#255) would need two taxonomies.
Agent drafts also arrive with no image. Images copied from source sites are a copyright risk, so every draft needs an image the site owns or is licensed to use. Media records can't say who took a photo or under what license, so the site can't credit it.
Owner decisions (2026-10-25, Claude session):
- Categories: one shared tree: events and posts use the same categories and subcategories.
- Images: category defaults plus links: each category gets a default image the site owns or is licensed to use; agents use it automatically and may list a source image only as a link with credit for the editor to approve, never uploading it.
Proposed fix
- Native first. Keep Payload's
categoriescollection and the official nested-docs plugin (already installed) as the one tree. A child category is a subcategory. - Events use the shared tree. Replace the events
categoryselect with acategoriesrelationship (hasMany,relationTo: 'categories', sidebar), like posts. A migration creates a category for each old value that has no category with that slug yet, links every event to it, then drops the old column. Cards and the event hero show the category title from the tree. - Default image per category. Add an optional
defaultImageupload to categories. Picking which image a draft gets (the category's, or its parent's) is a pure rule in the agents module (next issue). - Credit on media. Add
credit(who made it),license(select: own photo, used with permission, CC BY, CC BY-SA, CC0 / public domain, other) andsourceUrl(http(s) link) to media, all optional.
Acceptance criteria
- Not done: Events have a
categoriesrelationship to the shared tree; the old select is gone; existing events keep their category after the migration (tested on a copy of the schema with data). - Not done: Event cards, the event hero and the sidebar show the category title; nothing in the UI still reads the old values.
- Not done: Categories have an optional
defaultImage; media has optionalcredit,licenseandsourceUrl, withsourceUrlvalidated as an http(s) link. - Not done: Access unchanged: categories and media keep their current access;
accessPolicy.test.tspasses. - Not done: Types regenerated, migration committed, docs (
data-model.md,project.mdwhere it names the fields) updated. - Not done: Visual check of the event pages at the six widths in light and dark.
Area
cms, migration
Priority
high