Rich text
A prose section. The renderer wraps @bison-lab/ui’s RichText around the saved Lexical document.
There is no live preview on this page: the renderer needs @payloadcms/richtext-lexical, and loading it here would pull Payload into the docs bundle. For the same reason the renderer lives on its own entry, @bison-lab/payload-blocks/rich-text, so a site that does not use the block never loads Lexical either.
import { RichTextBlock } from "@bison-lab/payload-blocks";
// In the collection's `blocks` array:RichTextBlockimport { RichTextBlockRenderer } from "@bison-lab/payload-blocks/rich-text";
// In the site's registry:richText: RichTextBlockRenderer,Links inside the prose
Section titled “Links inside the prose”Links in a rich text section go through linkComponent like every other link, the ones Lexical auto-detects included. One kind needs more: a link an editor makes to another document has no URL, only the document, and the route is the site’s to know. That is the same fact resolveLink carries, but Lexical hands the renderer a link node rather than a link row. The factory takes the site’s resolver, unpacks the node with internalDocToHrefFrom, and calls it, so the page path is defined once:
"use client";import { richTextBlockRenderer } from "@bison-lab/payload-blocks/rich-text";import { resolveSiteLink } from "@/blocks/adapters";
export const SiteRichText = richTextBlockRenderer({ resolveLink: resolveSiteLink });Register SiteRichText in place of RichTextBlockRenderer. It has to be built in a "use client" module: the rich text entry carries the client banner, so the factory is a client reference a Server Component can pass along but cannot call, and the resolver is a closure that could not cross the boundary as a prop.
A hand-written internalDocToHref still works, and wins if both options are passed. An unpopulated or unpublished document follows the resolver’s null rule and maps to #; there is no second unpublished policy. Without any resolver an internal link still renders through the adapter, at #, with a console error naming the option. A site whose editors link between documents should not ship that way.
One node bypasses both seams: an upload an editor drops into the prose renders through Payload’s own converter, a file as a bare <a> and an image as a raw <img>, until BIS-76 routes them through the adapters.
Fields
Section titled “Fields”| Field | Type | Notes |
|---|---|---|
content * | richText |
* required.
Answers in the FAQ columns block are plain text for the same reason: prose with links and lists belongs here.