Closed jamestagal closed 1 year ago
No worries @jamestagal, it's constantly changing and undocumented at the moment, so confusion is expected :).
The id
type is actually used for randomly generating a string. This is typically used to tie together completely separate systems, like the default Plenti CMS and a database backend.
Preventing editing the name
field is a common pattern, I do this in my Plenti apps as well! You can do this without an ID field by using the disabled
option in a text
type field instead:
{
"name": {
"type": "text",
"options": [
"disabled"
]
}
}
Thanks again @jimafisk I am slowly getting a hang of how everything works in Plenti.
Ben
Hi @jimafisk,
I have been thinking of implementing a way to not allow changes/edits to
name
fields in components from the CMS editor. I wish to do this because thesename
fields are bound to theirsvelte
templates and if an editor unknowingly changes one of these fields on the frond end, the site would break. So one way to do this would be to use theuuid
ortype:"id"
to disable in the editor. Though, even after watching your video on doing this, I haven't yet been able to get it working but here's where I am at. 😊In the
pages
content, I have anaboutus.json
file that uses 5 components. So I have:aboutus
folder within the_components
folder_defaults.json
and_schema.json
_defaults.json
file here, I have added the default fieldname
such as:_schema.json
file here, I have added thetype
ofid
to thecomponents.name
field such as:Sorry for some many questions...I seem to always get stuck! 😨 Any help would be great. Thanks.
Ben