Write affordances
Writing a guide from the surface it explains, and the edit mode that gates those affordances.
Every surface without a guide can offer to create one, with the target already filled in.
The flow
Click Write this guide on an unguided field, block, document, or list. A create drawer opens on the wiki pages collection with the matching target list prefilled, so a guide about collection:posts.hero.headline starts with that path already in Fields. On save, the targets map refreshes and the affordance is replaced by the guide's own trigger, without a reload and without leaving the page.
When they render
Field-level surfaces put one affordance next to every unguided field, so the default is not "always":
adminWiki({
writeAffordances: 'editMode', // the default
})| Mode | Behavior |
|---|---|
editMode | Only while the reader has wiki edit mode on. Default |
always | Whenever the reader's create permission resolves true |
never | No write affordance anywhere; guides are authored from the wiki collection |
In every mode the affordance also requires the reader's create access on the wiki collection to resolve true.
Excluded entities carry no surfaces, so there is nowhere for an affordance to render and no way to reach a create drawer prefilled with one.
Wiki edit mode
Edit mode is a per-browser switch that turns the affordances on. It persists in localStorage, so it survives reloads and is shared across admin tabs, and it is off until someone turns it on.
The toggle sits in the wiki pages list view actions and in the header of the wiki index. It renders only when writeAffordances is editMode and the reader could author guides; under always or never there is nothing to switch and the pill is absent.
Shapes
One component and one flow, rendered three ways:
- Inline, a quiet line beside a field, next to that field's description
- Button, a pill on a list band or a document sidebar with no guides yet
- Menu item, a row in a popup list, for consumer surfaces that want one
Doing it yourself
WikiWriteGuide is exported from @10x-media/admin-wiki/client and takes a target key and a variant:
'use client'
import { WikiWriteGuide } from '@10x-media/admin-wiki/client'
<WikiWriteGuide targetKey="collection:posts" variant="button" />It renders nothing when the reader cannot write, so there is no permission check to write yourself. See Customization for the rest of the component API.
Next
Seeding for writing guides in code, or Configuration for the complete option reference.