# More Example and Screenshot about cockpit V2

**URL:** <https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435>\
**Category:** Cockpit v2\
**Created:** [August 2, 2022, 3:58am UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435 "2022-08-02T03:58:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![creativeplusplus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/creativeplusplus/32/844_2.png) [@creativeplusplus](https://discourse.getcockpit.com/u/creativeplusplus)\
**Post date:** [August 2, 2022, 3:58am UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435/1 "2022-08-02T03:58:06Z")

</div>

Dear Artur,

Can you give more example or screenshot of code what meta and condition can do?

 ![Screen Shot 2022-08-02 at 10.53.01](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/2X/6/6ce1e52c0d54569debbe252ce8a3327750cf90ef.png)

Thanks Artur for your awesome work

---

<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:** [August 2, 2022, 11:02am UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435/2 "2022-08-02T11:02:12Z")

</div>

Let’s say you only want to show a field if the title field is not empty. Then add the following in the condition field:

```auto
data.title && data.title.trim()

```

Docs will be updated soon

---

<div class="post-metadata">

**Author:** ![tiagorio](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/tiagorio/32/1214_2.png) [@tiagorio](https://discourse.getcockpit.com/u/tiagorio)\
**Post date:** [January 5, 2023, 10:19am UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435/3 "2023-01-05T10:19:17Z")

</div>

Hi Artur, I need to create a repeatable set of fields for a portfolio site, to emulate something similar to Wordpress Gutenberg. I used to do that in Cockpit V1 with a repeater/set combo.

What I need to do now is create a dropdown select at the top with the content type (image, gallery, featured text…). Then I want to hide/show the fields related to that content type. So basically the condition needs to be something like:  
`data.type='Gallery'`

 ![Screenshot 2023-01-05 at 10.22.37](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/2X/d/dbdd0080abf6f34257de81316eaac1f4caedccac.png)

However it is not working. Is there a different way to get the selected field value from the dropdown, or does the syntax needs to be different?

Could really use your help. Thanks!

---

<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:** [January 5, 2023, 11:28am UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435/4 "2023-01-05T11:28:54Z")

</div>

Hi @tiagorio 👋

For such use-case Cockpit offers the [layout field type](https://getcockpit.com/documentation/pro/layout/introduction) (part of Cockpit pro).

Greets  
Artur

---

<div class="post-metadata">

**Author:** ![tiagorio](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/tiagorio/32/1214_2.png) [@tiagorio](https://discourse.getcockpit.com/u/tiagorio)\
**Post date:** [January 5, 2023, 12:25pm UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435/5 "2023-01-05T12:25:18Z")

</div>

I’ve used the layout field type in V1, but isn’t exactly what I need for this case. I just want to create a list of content blocks that can easily be re-ordered or removed, without any grid. The grid is to be defined in the frontend code, and the backend user should have no control over that, other than adding or removing blocks.

Anyway, I just need to know how the hide or show a field, based on the dropdown selected option, is that possible?

---

<div class="post-metadata">

**Author:** ![tiagorio](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/tiagorio/32/1214_2.png) [@tiagorio](https://discourse.getcockpit.com/u/tiagorio)\
**Post date:** [January 13, 2023, 11:04am UTC](https://discourse.getcockpit.com/t/more-example-and-screenshot-about-cockpit-v2/2435/6 "2023-01-13T11:04:19Z")

</div>

I finally found the way, it’s:

`data.type=='SelectedOption'`

Replace the ‘SelectedOption’ by the value written in the dropdown.

And be careful tu use the double equal sign ‘==’, by mistake I used only one and it would set the value of all the Dropdown instances to that, and they would not work.
