# Custom settings for template modification

**URL:** <https://forum.ghost.org/t/custom-settings-for-template-modification/35436>\
**Category:** Developer help\
**Created:** [January 11, 2023, 11:18am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436 "2023-01-11T11:18:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghost2042392309](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@ghost2042392309](https://forum.ghost.org/u/ghost2042392309)\
**Post date:** [January 11, 2023, 11:18am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/1 "2023-01-11T11:18:52Z")

</div>

Hi,

- We have a number of hosted ghost sites
- We’ve created a custom template as all the sites are broadly similar
- We wanted the ability to change key elements of homepage text/images, so added them to custom settings
- Then found the limit of 15 settings
- Also settings get over-written when updating the theme

Is there any workaround where we could pull in data from another config file so that we can pull in different text/images etc. for each site? e.g. homepage blurb, header images etc.

Conscious this is is not what custom settings is meant for, so looking for any other options.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [January 11, 2023, 11:24am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/2 "2023-01-11T11:24:07Z")

</div>

Code injection could be an option, but then you’re doing that part of the rendering client side. Good for color changes, not so good for big layout changes.

You could also store the values you need in a page that you don’t link from anywhere and use a #get helper to retrieve them as needed.

---

<div class="post-metadata">

**Author:** ![ghost2042392309](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@ghost2042392309](https://forum.ghost.org/u/ghost2042392309)\
**Post date:** [January 11, 2023, 11:43am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/3 "2023-01-11T11:43:24Z")

</div>

Thanks @Cathy_Sarisky

Re: the second option, i’d considered that, but couldn’t work it out. Could I store them notionally as a json file in a page, then pull them out? Or do you mean use the get helper to only pull the preset options (eg. excerpt, feature\_image etc.).

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [January 11, 2023, 11:59am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/4 "2023-01-11T11:59:25Z")

</div>

If you open the right side menu on a post or page, there are a /lot/ of fields there. I’ve previously stashed values I needed in a page that I just didn’t route from anywhere. (Googlebot may find it from the sitemap, but I don’t really care.) So you use the #get helper to get that specific page, and then you’ve got access to all the values on it. It’s hacky, but it’s editable (with directions) on the front end, and it’s all server side.

---

<div class="post-metadata">

**Author:** ![ghost2042392309](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@ghost2042392309](https://forum.ghost.org/u/ghost2042392309)\
**Post date:** [January 11, 2023, 11:59am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/5 "2023-01-11T11:59:52Z")

</div>

Got it, that’s helpful, thank you.

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [January 11, 2023, 12:09pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/6 "2023-01-11T12:09:17Z")

</div>

> [@ghost2042392309](#):
>
> Also settings get over-written when updating the theme

Settings shouldn’t be overwritten, unless I’m misunderstanding what you are doing. Are keeping the same folder name when uploading the new theme? If not then you are creating a new theme each time rather than updating a theme - new themes will always use the default custom setting values because they don’t have any previous values to continue using.

---

<div class="post-metadata">

**Author:** ![ghost2042392309](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@ghost2042392309](https://forum.ghost.org/u/ghost2042392309)\
**Post date:** [January 11, 2023, 12:52pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/7 "2023-01-11T12:52:22Z")

</div>

Oh dear, yes that’s possible @Kevin . I may have been inadvertently creating a new theme each time. That at least solves that issue! Thanks.

That said, if I have over 15 custom settings, how critical an error would that be?

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [January 11, 2023, 3:05pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/8 "2023-01-11T15:05:04Z")

</div>

It’s not a fatal error so Ghost will still work with a theme containing \>15 custom theme settings but the error will show up when activating the theme and may surface in other places.

Do the custom settings need to be editable from the admin area of each site or is their purpose only to avoid having a separate theme for each one?

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [January 11, 2023, 3:14pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/9 "2023-01-11T15:14:20Z")

</div>

@Kevin, do you know if custom values beyond the 15th are accessible in the .hbs files? I’d totally let Ghost throw an error on theme install if it got me a 16th and 17th (and 18th and…) setting, in some cases.

---

<div class="post-metadata">

**Author:** ![ghost2042392309](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@ghost2042392309](https://forum.ghost.org/u/ghost2042392309)\
**Post date:** [January 11, 2023, 3:19pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/10 "2023-01-11T15:19:33Z")

</div>

I’d second @Cathy_Sarisky 's question

> Do the custom settings need to be editable from the admin area of each site or is their purpose only to avoid having a separate theme for each one?

Primary reason was to avoid having a separate theme for each one, but secondary reason was to allow non-devs to edit various content across the site.

Is there another way if it didn’t need to be editable in the admin?

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [January 11, 2023, 8:47pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/11 "2023-01-11T20:47:06Z")

</div>

> [@Cathy\_Sarisky](#):
>
> do you know if custom values beyond the 15th are accessible in the .hbs files? I’d totally let Ghost throw an error on theme install if it got me a 16th and 17th (and 18th and…) setting, in some cases.

They are. However theme errors will be shown quite prominently in Admin’s sidebar from 5.28.0 onwards so probably not something you’d want outside of development.

Interested to hear what the use-cases are for having more settings. 15 was chosen as a decent limit for settings to avoid themes having everything under the sun configurable and becoming multiple-themes-in-one (with the resulting usability problems for theme end-users) which is a problem some theme marketplaces suffer from.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [January 11, 2023, 8:55pm UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/12 "2023-01-11T20:55:25Z")

</div>

Sure, here’s one:  
Customer wants a banner across the top of all pages. Sometimes. (One config setting for on/off)  
They want to pick the color (2)  
They want to enter the text for the banner (3)  
They have subtext (4)  
They want to have a button with text on it (5)  
They want to customize the URL (6)

That’s six config settings used up on one small feature.

Social media (0-25 config settings - no one wants all 25, but lots of users want 2-4, and which 2-4 varies a LOT)

When I customize other designers’ themes, I often find they’ve already used 10-15 of the custom settings. That doesn’t give me much to work with if the customer wants something user-editable in the admin panel.

---

<div class="post-metadata">

**Author:** ![ghost2042392309](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@ghost2042392309](https://forum.ghost.org/u/ghost2042392309)\
**Post date:** [January 12, 2023, 10:35am UTC](https://forum.ghost.org/t/custom-settings-for-template-modification/35436/13 "2023-01-12T10:35:01Z")

</div>

Yes, for us anyway, primary use case is being able to make changes that don’t sit in a page or a post, where we’re using a template across multiple sites. In this case, we’re using it less for layout configuration changes and more for content insertion that doesn’t change regularly, but makes it easier for non-devs to be able to make the changes from the admin panel.
