# How to ceate default Field Type 'set'

**URL:** <https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809>\
**Category:** Support\
**Created:** [May 5, 2019, 9:29am UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809 "2019-05-05T09:29:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafaelsmith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/rafaelsmith/32/320_2.png) [@rafaelsmith](https://discourse.getcockpit.com/u/rafaelsmith)\
**Post date:** [May 5, 2019, 9:29am UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/1 "2019-05-05T09:29:56Z")

</div>

Hey Lovely people!  
I want to build default `Field Type` that make `set` with this Options:

```
 {
   "fields": [
     {
       "type": "slug",
       "name": "slug",
       "label": "Slug"
     },
     {
       "type": "collectionlink",
       "name": "components",
       "label": "Components",
       "options": {
         "link": "components",
         "multiple": false
       }
     }
   ]
 }
```

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [May 5, 2019, 1:53pm UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/2 "2019-05-05T13:53:26Z")

</div>

Please add some more details. I don’t understand, what you’re trying to achieve. What’s the actual problem and what do you mean with “default”?

---

<div class="post-metadata">

**Author:** ![rafaelsmith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/rafaelsmith/32/320_2.png) [@rafaelsmith](https://discourse.getcockpit.com/u/rafaelsmith)\
**Post date:** [May 5, 2019, 2:09pm UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/3 "2019-05-05T14:09:03Z")

</div>

Thanks for your reply,  
So I have in every singleton Field  
name: template  
type: set  
option:

```auto
 {
   "fields": [
     {
       "type": "slug",
       "name": "slug",
       "label": "Slug"
     },
     {
       "type": "collectionlink",
       "name": "components",
       "label": "Components",
       "options": {
         "link": "components",
         "multiple": false
       }
     }
   ]
 }

```

And I don’t want every time to copy that, I want to build field type like that,  
I try to use with Layout Components, but it’s make the data very deep, I need it in the root or maximum as a son

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [May 6, 2019, 12:41pm UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/4 "2019-05-06T12:41:42Z")

</div>

I never used the Layout Components Addon or the layout builder fields. I can’t help here. But if you want to create custom fields, you can look at the [core fields](https://github.com/agentejo/cockpit/tree/next/modules/Cockpit/assets/components), modfiy them and place them in `/path/to/cockpit/config/tags`.

---

<div class="post-metadata">

**Author:** ![rafaelsmith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/rafaelsmith/32/320_2.png) [@rafaelsmith](https://discourse.getcockpit.com/u/rafaelsmith)\
**Post date:** [May 6, 2019, 5:19pm UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/5 "2019-05-06T17:19:16Z")

</div>

> [@raffaelj](#):
>
> But if you want to create custom fields, you can look at the [core fields](https://github.com/agentejo/cockpit/tree/next/modules/Cockpit/assets/components), modfiy them and place them in `/path/to/cockpit/config/tags` .

This is what I tried to do but I don’t know how actually to use with “set” and put my default options as new custom fields ☹

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [May 6, 2019, 6:18pm UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/6 "2019-05-06T18:18:27Z")

</div>

I wrote a demo file. Adjust it to your needs.

> <https://github.com/raffaelj/cockpit-scripts/blob/master/custom-fields/field-customset.tag>

---

<div class="post-metadata">

**Author:** ![rafaelsmith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/rafaelsmith/32/320_2.png) [@rafaelsmith](https://discourse.getcockpit.com/u/rafaelsmith)\
**Post date:** [May 7, 2019, 7:29am UTC](https://discourse.getcockpit.com/t/how-to-ceate-default-field-type-set/809/7 "2019-05-07T07:29:19Z")

</div>

Thank you very much! you are the BEST!
