Search code examples
keystonejs

How to specify a Fieldset in the KeystoneJS Admin App?


Is it possible to specify a FieldSet in the Admin App, in Keystone_v5 ?

I just want to group all SEO fields under a field set.


Solution

  • This functionality never made it into Keystone 5. The best you could do is either model those fields in a separate list as you suggest, or perhaps create a custom field type.

    Custom field types can write out to multiple columns in the database (so you don't need to change your DB structure) and they give you complete control over how the inputs are rendered and laid out in the Admin UI (so you could, for example, add a section heading, etc). Unfortunately, creating custom field types in v5 isn't well documented; you basically need to look at the existing field type source code and copy those patterns.

    Alternatively, field groups will be supported in the Keystone 6 which is currently in preview release. Some work has been completed already (though the remainder has not been scheduled). My guess is it'll roll out before the end of September. Keep and eye on the release notes if you're interested. Creating custom field types in v6 is also much easier if you wanted to take that route.