# How are theme setting fields created?

**URL:** https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353
**Category:** Support
**Created:** [April 28, 2018, 7:39am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353 "2018-04-28T07:39:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Biscuit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/biscuit/32/94482_2.png) [@Biscuit](https://meta.discourse.org/u/Biscuit)
#### Post date: [April 28, 2018, 7:39am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/1 "2018-04-28T07:39:48Z")

</div>

When you import the theme below from Github, “theme settings” appear set under Customize \> Theme \> Theme\_Name.

> [@Custom Header Links (icons)](https://meta.discourse.org/t/iconified-header-links/86307):
>
> discourse2Summary Custom Header Links (icons) will allow you to easily add linked icons to the Discourse header.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/custom-header-links-icons)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-icon-header-links](https://github.com/discourse/discourse-icon-header-links)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features Screenshots Desktop Mobile Settings This component includes a …

 ![Theme_Settings](https://global.discourse-cdn.com/meta/original/3X/a/a/aa57a1073b36f6bff85ad72961487e491ccdd936.png)

The Github files include a YML file with the theme settings inside it. The “Import theme” process presumably uses that YML file to make the setting fields appear. But, when I’m writing my own theme (not plugin), how do I create theme settings / parameters like this?

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [April 28, 2018, 7:58am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/2 "2018-04-28T07:58:20Z")

</div>

This should be what you are looking for 🙂: [Add settings to your Discourse theme](https://meta.discourse.org/t/how-to-add-settings-to-your-discourse-theme/82557)

---

<div class="post-metadata">

### Author: ![Biscuit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/biscuit/32/94482_2.png) [@Biscuit](https://meta.discourse.org/u/Biscuit)
#### Post date: [April 28, 2018, 9:16am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/3 "2018-04-28T09:16:09Z")

</div>

How did I miss that topic!

Looks like it can’t be done via the interface and requires the files to be placed on Github. Never posted on Github before, so will have to give it a try, to test myself.

Thank you.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [April 28, 2018, 9:40am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/4 "2018-04-28T09:40:42Z")

</div>

No problem 🙂

You don’t technically need to do anything on GitHub, the [Install the Discourse Theme CLI console app to help you build themes](https://meta.discourse.org/t/discourse-theme-cli-console-app-to-help-you-build-themes/82950) is really all you need to get started. It’s an extremely handy tool and easy to set up. I highly recommend giving it a try!

---

<div class="post-metadata">

### Author: ![sarahann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sarahann/32/96703_2.png) [@sarahann](https://meta.discourse.org/u/sarahann)
#### Post date: [May 8, 2018, 12:27am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/5 "2018-05-08T00:27:47Z")

</div>

Does anyone know how one would access variables in the theme settings in Javsscript?

```
<script type="text/discourse-plugin" version="0.8.13">
    console.log(themeSettings.myvalue); 
</script>

```

I keep getting “themesettings is not defined” in the dev tools

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [May 8, 2018, 1:43am UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/6 "2018-05-08T01:43:03Z")

</div>

You almost had it. It’s actually just `settings` not `themeSettings` 🙂

---

<div class="post-metadata">

### Author: ![sarahann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sarahann/32/96703_2.png) [@sarahann](https://meta.discourse.org/u/sarahann)
#### Post date: [May 8, 2018, 4:30pm UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/7 "2018-05-08T16:30:24Z")

</div>

Thank you @tshenry! I also had it in the wrong file.

My code was in /common/header.html instead of /common/head\_tag.html

Thank you for your help! 🙂

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 30, 2019, 1:54pm UTC](https://meta.discourse.org/t/how-are-theme-setting-fields-created/86353/8 "2019-07-30T13:54:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
