Some questions / feature requests about field structures

my last project with Cockpit CMS I’ve made half a year ago. In the meantime some of my requested features implemented like the built-in way to create custom layout components. But I really miss some features or I am not able to find them. In my current project I create a “onepager” for my customer. The fieldtype layout fits perfect for this. I create my custom components for this field.


Custom layout components - preview

There is no preview functionality for custom layout components. This makes it a bit annoying to create the page and its content. As a workaround I use the built-in “Text”-component to give my customer the possibility to write some notes to the not previewed components. This build-in component renders a preview. I would really appreciate a way to configure custom components to render a preview in the form layout components


Copying structures

Custom layout components, Singletons or Collections… it would be really nice if I could copy the field types-structure from an existing one. Yes, I know - maybe there is a way to copy the entry from the SQLite file but an user friendly way would be much nicer.


Importing predefined structures

The following is related also to create Singletons, custom layout components and so on. It would be nice to have a way to include some predefined parts to the fields structure. What I mean is for example all of my custom components shall get the possibility to be configured as a target of an anchor navigation (by an ID, scroll-to … you know what I mean). So all custom components gets the same form fields for this navigation part (currently grouped as “Navigation” and displayed as new tab). It would be really nice if there is a way to define a field structure in a central space and to include/import it where I want to use it. Another big benefit of this: If I change anything in this structure all of the importing components/Singletons/… would be affected by one change.

Best regards, Ron

You could try my new BlockEditor addon, that replaces the layout field. I addressed some of your points there.

If you tested it, please give some feedback in the BlockEditor addon thread or open an issue with a feature request in the BlockEditor issues section.

If you create your custom components with the LayoutComponents addon, your components are stored in storage/components.json. Copy/paste inside a json file is still not very user friendly, but you don’t need to look in the database.

Custom components defined via field options are stored in storage/collections/collection_name.collection.php (see the fields array). You could copy/paste from there - without touching a database.

In the BlockEditor addon, I replaced the settings page of the LayoutComponents addon to have some more options, e. g. to duplicate core components.