Replies: 2 comments 2 replies
-
|
I would vote a implementation like this: Target collection should not be immutable. The content picker should show all status. Reverse links are useful but not needed in the first implementation. Multiple references should be supported in the future at least. |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Coming from this as a content editor, rather than a developer, I'd love to see something like Voxel's (WP) implementation of their Reference Field, as a future goal. https://docs.getvoxel.io/articles/post-relation-field-2/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current state
The
referencefield type exists throughout the codebase as a recognized type, but the admin UI was never built out. The scaffolding is all there — the type is defined, the DB column type is mapped, the manifest correctly surfaceskind: "reference"for DB-backed fields — but neither the schema editor nor the content editor has the UI to make it usable.What's missing
1. No collection picker when creating a reference field
FieldEditor(the dialog for adding fields to a collection) has type-specific configuration UI forselect/multiSelect(options list),string/text(min/max length, pattern), andnumber/integer(min/max value). Forreference, there is no step to select which collection the field points to.FieldWidgetOptionsalready hascollection?: stringwith the comment "For reference - which collection to reference", but it's never populated because the UI to collect it doesn't exist.2. Plain text input instead of a content picker when editing content
ContentEditor'sFieldRendererhas aswitch (field.kind)with cases for all the common types. There is nocase "reference":. It falls through todefault:, which renders a plain<Input>— so editors currently see a free-text box and would have to type a raw content ID by hand.ContentPickerModalalready exists (it's wired up inMenuEditorfor picking menu items) and is fully capable of browsing collections with search and pagination. It just isn't wired intoContentEditorfor reference fields.3.
isReferencemarker missing in the static field helperfields/reference.tsreturns a plainz.string()schema with noisReferenceflag. The manifest handler inapi/handlers/manifest.tschecksschema.isReferenceto detect reference fields in the staticlive.config.tspath — but since the flag is never set, that check never fires. Fields defined statically viareference()would getkind: "string"in the manifest instead ofkind: "reference". (The DB-backed path is unaffected — it usesFIELD_TYPE_TO_KINDdirectly and correctly maps to"reference".)Design questions that need answers before implementation
options.collectionpointer should be too.ContentPickerModalshows all statuses.allowMultiple?FieldWidgetOptionsalready hasallowMultiple?: booleanfor reference fields. Should multi-reference be in scope here or deferred?What a complete implementation would involve
FieldEditorwhenselectedType === "reference", persisting the chosen collection tooptions.collection.case "reference":toContentEditor'sFieldRenderer, openingContentPickerModal(or a similar picker) filtered to the collection stored infield.options.collection.fields/reference.tsto tag the schema withisReference: trueso the static manifest path works correctly.Beta Was this translation helpful? Give feedback.
All reactions