FAQ Library
createQuestions and createTaxonomy ship from the React-free @bison-lab/payload-core entry. The kit List is @bison-lab/payload-core/admin#QuestionsList — a site runs payload generate:importmap.
One document per FAQ: question, rich-text answer (the same default Lexical editor as the pages rich text block, no custom feature set), drafts. Publish is per row. There is no page field. Used-on stays 0 until a later block stores relationships. A site that registers createQuestions needs editor: lexicalEditor() on the Payload config — the same root editor that block uses. Hidden answerText is the varchar the list searches; syncAnswerText writes it on create and on any update that includes answer. Spreading the collection to replace hooks.beforeChange drops that write and search stops matching answers. Do not query answer with contains — on Postgres that is ilike against jsonb and the request fails.
Pass Anatomy-like collections and Topics through organizeBy. The package does not know “anatomy”. Feature slug questions is a site extra, the same way Navigation is.
import { canUseFeature, createFeatures, createQuestions, createTaxonomy } from "@bison-lab/payload-core";
createFeatures({ extras: [ { slug: "navigation", label: "Navigation" }, { slug: "questions", label: "FAQ Library" }, ],});
createTaxonomy({ slug: "topics", labels: { singular: "Topic", plural: "Topics" }, access: { read: () => true, update: canUseFeature("questions") },});
createQuestions({ organizeBy: [ { name: "anatomy", label: "Anatomy", collection: "anatomy", manage: false, look: { global: "anatomy" }, }, { name: "topics", label: "Topics", collection: "topics", manage: true }, ],});Each entry’s field is facetField({ name, label, collection }), exported from @bison-lab/payload-core (and from the React-free @bison-lab/payload-core/taxonomy): a stock relationship, hasMany, onto the terms collection. Use it for any other collection a site tags from the same taxonomy, so the field is the same everywhere; the Resources block’s createResourcesBlock({ facets }) builds its tags with it.
manage: true lets editors add and delete terms from Manage organization. Deleting a topic removes the assignment, not the FAQs. Linked collections stay read-only there.
look is optional. When set, anatomy chips read Theme family from that Global (areas[].label / areas[].family by default) and set data-look so they pick up --look-tint / --look-ink. A term document that already stores family or look wins.
The list wraps kit Page (Payload --gutter-h, no max-width). Create and edit is a kit dialog: question, Lexical answer, one checkbox list per facet, Published switch. The stock document form is not the editor path. Unpublished rows are not publicly readable (authenticatedOrPublished).
Then payload generate:importmap, payload generate:types, and payload migrate:create.