# Settings not appearing

**URL:** https://meta.discourse.org/t/settings-not-appearing/327372
**Category:** Development
**Created:** [September 20, 2024, 7:39am UTC](https://meta.discourse.org/t/settings-not-appearing/327372 "2024-09-20T07:39:59Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 20, 2024, 7:39am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/1 "2024-09-20T07:39:59Z")

</div>

Hi everyone, I’m getting started on developing things for Discourse, and I’m working on a theme component.  
Link: [GitHub - NateDhaliwal/discourse-persistent-banner: A theme component for Discourse that cannot be closed by the user. · GitHub](https://github.com/NateDhaliwal/discourse-persistent-banner)

When putting it on Theme Creator, the settings don’t appear, even though I have a `settings.yml`. Any ideas?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 20, 2024, 8:28am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/2 "2024-09-20T08:28:09Z")

</div>

Do you see any error messages at theme creator?

> <https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/settings.yml#L4-L4>

I think you have to use the same quotation marks at the beginning and end.

> <https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/settings.yml#L12-L12>

This could also be a problem. I would try `default: ""`

> <https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/settings.yml#L16-L21>

Maybe you want to add “block” to the choices. Otherwise you have to use the revert button to choose that again.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 20, 2024, 10:45am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/3 "2024-09-20T10:45:44Z")

</div>

Whoops, just realised I was clicking on ‘Create new’ instead of importing it…  
But now, when I try using the URL, it says that `about.json` is invalid or doesn’t exist, asking me if it is a theme.  
About.json:

> <https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/about.json>

Is there something wrong?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 20, 2024, 10:48am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/4 "2024-09-20T10:48:19Z")

</div>

Missing comma after license URL.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 20, 2024, 10:54am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/5 "2024-09-20T10:54:52Z")

</div>

🙄  
@merefield Would version be in `""`?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 20, 2024, 10:58am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/6 "2024-09-20T10:58:28Z")

</div>

Probably that too. Just look at examples.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 20, 2024, 11:00am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/7 "2024-09-20T11:00:56Z")

</div>

Thanks! One last one, I can’t seem to get the variable to display.  
[https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/common/header.html](https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/common/header.html)

Was it because I didn’t initialise it properly? I tried following the guide…

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 20, 2024, 11:09am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/8 "2024-09-20T11:09:35Z")

</div>

1. don’t use “header.html”, use a proper component (preferably a .gjs file, but .hbs might suffice).
2. use `html-safe` helper whenever outputting html from settings or variables.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 20, 2024, 11:11am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/9 "2024-09-20T11:11:51Z")

</div>

Would I have to use

```js
import Component from "@glimmer/component";

export default class PracticeComponent extends Component {
  get bannerLinks() {
    return JSON.parse(settings.banner_links);
  }
}

```

then?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 20, 2024, 11:13am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/10 "2024-09-20T11:13:08Z")

</div>

Look at the billions of examples 😜

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 20, 2024, 11:22am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/11 "2024-09-20T11:22:22Z")

</div>

You only need to use a gjs file if you need to process stuff with javascript, otherwise an hbs template file might suffice. Experiment.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 21, 2024, 7:36am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/12 "2024-09-21T07:36:06Z")

</div>

I’m not sure if I’m going in the right direction.  
I made `javascripts/persistent-banner.hbs` with this:  
[https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/javascripts/persistent-banner.hbs](https://github.com/NateDhaliwal/discourse-persistent-banner/blob/main/javascripts/persistent-banner.hbs)

But nothing shows up. Tried putting it in different places, still won’t work.

Tried looking at example, but many don’t seem to help.  
Any advice?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 21, 2024, 11:51am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/13 "2024-09-21T11:51:06Z")

</div>

In which plugin outlet do you want to put your banner?  
Take a look at [Using Plugin Outlet Connectors from a Theme or Plugin](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727)

> [@Using Plugin Outlet Connectors from a Theme or Plugin](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727/1):
>
> `data-template-name='/connectors/{outlet-name}/{connector-name}'`

You could use [https://meta.discourse.org/t/add-a-featured-topic-list-to-your-discourse-homepage/132949?u=moin](https://meta.discourse.org/t/add-a-featured-topic-list-to-your-discourse-homepage/132949) as an example

> [@Discourse](#):
>
> `data-template-name="/connectors/above-main-container/featured-topics"`

You can use the [(deprecated) Plugin outlet locations theme component](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673) to find the names and locations of the plugin outlets. “above-main-container” for example is the top one above the topic list, but not above the sidebar.

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/6/4/96444f9c6e89cf7e8eb8652d3c4a55baaeb9ceac.png)

Looking at the code of a #Customization > Theme component which adds something similar is also a great way to learn.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 21, 2024, 11:57am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/14 "2024-09-21T11:57:01Z")

</div>

You do not need and should not put script tags in hbs files. They should be limited to the content of the template.

Don’t stab in the dark, read the guides:

> **[Template-Only Components - Glimmer Components - Octane Upgrade Guide - Ember...](https://guides.emberjs.com/v4.2.0/upgrading/current-edition/glimmer-components/#toc_template-only-components)**
>
> There's a new component API in Octane! For this section, we'll be focusing on the differences between the new style, known as Glimmer components, and classic components, and how to upgrade. "Classic" components refer to older-style components that do...

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 22, 2024, 2:22am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/15 "2024-09-22T02:22:43Z")

</div>

So… I managed to get it working without using a hbs file, but instead using the `<script>` tag with handlebars, and it now works.  
I use it like this for now, but I’ll continue to try using a hbs file instead.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [September 22, 2024, 3:24am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/16 "2024-09-22T03:24:08Z")

</div>

created a quick pull request for you so you can see the way to split up the files properly. feel free to merge or just have a look at the [branch](https://github.com/Lillinator/discourse-persistent-banner/tree/split-into-handlebars-files).

[https://github.com/NateDhaliwal/discourse-persistent-banner/pull/3](https://github.com/NateDhaliwal/discourse-persistent-banner/pull/3)

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 22, 2024, 4:01am UTC](https://meta.discourse.org/t/settings-not-appearing/327372/17 "2024-09-22T04:01:16Z")

</div>

Thanks so much! It works now!

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [September 22, 2024, 3:15pm UTC](https://meta.discourse.org/t/settings-not-appearing/327372/18 "2024-09-22T15:15:43Z")

</div>

No worries Nate. Keep up the experimenting, reading and looking at other examples. In no time you’ll be much better than I am at this dev stuff 😃 🙌

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 22, 2024, 10:57pm UTC](https://meta.discourse.org/t/settings-not-appearing/327372/19 "2024-09-22T22:57:39Z")

</div>

Thanks for the encouragement!

---

<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: [October 22, 2024, 10:58pm UTC](https://meta.discourse.org/t/settings-not-appearing/327372/20 "2024-10-22T22:58:39Z")

</div>

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