# Layout field type

**URL:** <https://discourse.getcockpit.com/t/layout-field-type/303>\
**Category:** Support\
**Created:** [September 27, 2018, 2:31pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303 "2018-09-27T14:31:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rozkalns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/rozkalns/32/114_2.png) [@Rozkalns](https://discourse.getcockpit.com/u/Rozkalns)\
**Post date:** [September 27, 2018, 2:31pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303/1 "2018-09-27T14:31:33Z")

</div>

I really like this Layout field type, but I am having hard times selling this to other guys on the team that this should be the way to go.

 ![admin](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/1X/41fa6f5cb4e60df0e7a4d274f1e93718846bb06a.jpeg)

This is how the Project page editor might look like, but the issue with the Layout editor is that all editing is happening in the modal screens and it is not distinguishable if the content has been filled or not, or get the feeling of it.

Would it be possible to expand all the views right there on the spot and give opportunity to enlarge editing area if needed.

For example - Wordpress Gutenberg plugin. The editing of the content is very nice, everything else - a crap. This is why I wanted to recreate best parts of Wordpress here in new technology, but seems to be quite hard.

Or maybe again - is this the mindset? Or, I need to approach this kind of editing a little bit different? Would really nice to hear from you, more experience guys!

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [September 28, 2018, 11:09am UTC](https://discourse.getcockpit.com/t/layout-field-type/303/2 "2018-09-28T11:09:40Z")

</div>

I tested many scenarios and this one made the most sense. this is the best compromise for now between managing a “layout” while also having the ability to add custom components easily ([https://github.com/agentejo/LayoutComponents](https://github.com/agentejo/LayoutComponents)).

You can also combine this with the collection preview feature to get better feeling/relation of the content and output

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/1X/693e01bca5ce117dfa761644806fc0a4d686b305.jpeg)

---

<div class="post-metadata">

**Author:** ![Rozkalns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/rozkalns/32/114_2.png) [@Rozkalns](https://discourse.getcockpit.com/u/Rozkalns)\
**Post date:** [September 28, 2018, 12:32pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303/3 "2018-09-28T12:32:29Z")

</div>

Layout components is great idea!

Although, I figured out if I use Layout or Layout Grid field type, this already defines kinda the presentation layout, which is not the best way to pass data to multiple devices if needed.

I mean, if we want to use best practices of Headless CMS, layouts have to be decoupled away to different collections, and that way the api response would be more usable across the devices. Like on @pauloamgomes React-Cockpit example.

Of course, I would like to have a bit better way to manage (add, edit) those “layout” collection items and define relationships (also see relation where it was linked, like if I have Banner collection item, and this is linked to BasicPage collection Services item).

/Rob

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [September 28, 2018, 1:39pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303/4 "2018-09-28T13:39:38Z")

</div>

Keep in mind that the react cockpit example was mostly a PoC and before the evolution of the layout components.

But agree that the layout field could be improved, perhaps by having an expand cta that could display the metadata of the component (probably just a snippet of it), so when the component cards are expand it will look like:

![expanded-layout](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/1X/17539349db6554c8a27bd30bbb0e27a8ba320a11.png)

What you think @artur ?

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [September 28, 2018, 1:52pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303/5 "2018-09-28T13:52:41Z")

</div>

Thanks for the suggestion, I’ll do some testing and see how it feels/performs

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [January 8, 2019, 6:46pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303/6 "2019-01-08T18:46:45Z")

</div>

Hey @artur, think this one is still in standby, but to avoid moving that complexity to core why not to provide a hook for formatting the label?!

I created the PR [https://github.com/agentejo/cockpit/pull/966](https://github.com/agentejo/cockpit/pull/966) for that, please kindly confirm if it make sense, at least it can help a lot who needs some flexibility on changing what is displayed in the components.

---

<div class="post-metadata">

**Author:** ![flommy](https://avatars.discourse-cdn.com/v4/letter/f/8dc957/32.png) [@flommy](https://discourse.getcockpit.com/u/flommy)\
**Post date:** [October 16, 2020, 3:00pm UTC](https://discourse.getcockpit.com/t/layout-field-type/303/7 "2020-10-16T15:00:31Z")

</div>

Old thread, I know… But I recently added this PR: [https://github.com/agentejo/cockpit/pull/1349](https://github.com/agentejo/cockpit/pull/1349) to eleviate the very same problem but creating a hook in the new getPreview functionality instead.  
And then I wrote a custom addon that handles my custom layout components previews.
