<p>I would say the easiest thing is to create a set of Globals with all site specific settings. You can include custom settings for sites via Behaviors and Events and include your custom HTML and run custom logic to store those values in custom tables but I doubt it's worth it. A global set should be fine.</p>

<p>By the way: GlobalSets are site specific - you don't need to include a site handle or something. Just insert different settings for each site, Craft will fetch the correct one by itself.</p>

<p>If you want to loop a set for all sites</p>

<pre class="lang-TWIG prettyprint-override"><code>{% for site in craft.app.getSites().getAllSites() %}
    {% set globalSet = craft.app.globals.getSetByHandle('myset', site.id) %}
    {{ globalSet.myValue }}
{% endfor %}
</code></pre>

CC BY-SA 4.0
2019-04-01T11:56:44.937Z
Ah so I wont need to do any relationships between globals and the Sites. This is what put me off. But without relationships, then it becomes easier and I guess the same coding needed even if it were in the sites settings. So sound like it will be fine, thanks. Although it would be cleaner to have all the sites settings in one place though.
Laurence Cope
CC BY-SA 4.0
2019-04-01T12:23:01.567Z
You could create a matrix then and create a custom field type that is able to select sites, then you create a new block for each site
Robin Schambach
CC BY-SA 4.0
2019-03-29T13:39:31.527Z
2019-03-29T13:39:31.527Z
Robin Schambach
<p>In Craft 3 Sites, there are some default fields like language, handle, etc. </p>

<p>I would like to add additional fields. Is this possible. Specifically, I want to add an Image field so we can add a flag that we will use in the front end switcher. We also use Geo location and the Geo location databases have their own country identifiers (e.g. Maxmind returns GB for UK), and so I would like to have a field for the Maxmind country code when creating a site so we can match it. </p>

<p>Is this possible? I could probably create a new channel or globals in which we can enter the Site handle, then fetch this data for the site on the front end, but it would be cleaner to have additional fields in the Sites settings. </p>

<p>Thanks</p>

<craft3><custom-field><sites>
How can additional custom fields be added to the Sites settings?
# How can additional custom fields be added to the Sites settings?

(Asked by: username_0 on 2019-03-29)

In Craft 3 Sites, there are some default fields like language, handle, etc.

I would like to add additional fields. Is this possible. Specifically, I want to add an Image field so we can add a flag that we will use in the front end switcher. We also use Geo location and the Geo location databases have their own country identifiers (e.g. Maxmind returns GB for UK), and so I would like to have a field for the Maxmind country code when creating a site so we can match it.

Is this possible? I could probably create a new channel or globals in which we can enter the Site handle, then fetch this data for the site on the front end, but it would be cleaner to have additional fields in the Sites settings.

Thanks

**Tags:** craft3, custom-field, sites

---

## 1 answers

### Answer by username_1 on 2019-03-29. Score: 2

I would say the easiest thing is to create a set of Globals with all site specific settings. You can include custom settings for sites via Behaviors and Events and include your custom HTML and run custom logic to store those values in custom tables but I doubt it's worth it. A global set should be fine.
By the way: GlobalSets are site specific - you don't need to include a site handle or something. Just insert different settings for each site, Craft will fetch the correct one by itself.
If you want to loop a set for all sites
{% for site in craft.app.getSites().getAllSites() %}
    {% set globalSet = craft.app.globals.getSetByHandle('myset', site.id) %}
    {{ globalSet.myValue }}
{% endfor %}

> **Comments:**
> **username_0**: Ah so I wont need to do any relationships between globals and the Sites. This is what put me off. But without relationships, then it becomes easier and I guess the same coding needed even if it were in the sites settings. So sound like it will be fine, thanks. Although it would be cleaner to have all the sites settings in one place though.  
> **username_1**: You could create a matrix then and create a custom field type that is able to select sites, then you create a new block for each site  

---

