A few of us are having some issues @tshenry
Issue logged on GitHub by @craigconstantine
I note that @tshenry did something [he explained, but it went over my head] to one of my discourse installs (hosted by discourse.org) and the error is gone on that install at this time…
There is a bug in core Discourse that is misinterpreting the SASS site setting variable. For some reason it thinks the variable name has dashes instead of underscores. We are going to try to get the issue fixed.
In the mean time if you make any change to a theme setting, the error should clear. For example, I added a space to one of the column content
theme settings, saved it, removed the space and saved again.
Let me know if you find anything isn’t working after trying that.
I was about a week behind latest, updated Discourse this morning and the warnings have gone away
The Versatile Banner says this:
Customize the content of the banner with HTML. If you need to style your custom content with CSS, create a separate theme component.
Can somebdy explain or show pointers to what needs to be done for me to add CSS here?
Create a theme component as described at Beginners’ guide to using Theme Creator and Theme CLI to start building a Discourse theme, Developer’s guide to Discourse Themes or any of several other topics you can find by searching “theme developer”.
If that’s not helpful then you’ll need to say more about what you are trying to do.
Hi, is it possible to convert the text from the Versatile Banner through different locales ? I’d be interested in translating the UI from french to german depending on the locale
I don’t know. But Adding localizable strings to themes and theme components might offer some clues. I think that you need to fork the theme component, but I’m not sure and haven’t looked at the code lately to know if I’m right.
Sadly the theme theme translations feature Jay mentioned came out right before this component was created and I don’t think the documentation was posted until I had started working on it. It would be very difficult to update it to support multiple translations at this stage without breaking existing Versatile Banners out there The fork approach is probably your best bet.
My hope is that at some point we’ll get a “Versatile Banner 2” out there that can address some of the missing features and requests that have come in through the years.
Is there a way to show banner on topics under a single category? Versatile banner uses URL and wildcards, but discourse does not contain category name on URL. Or is there a way to add category to topic URL?
You can add it to a specific category by adding a link like eg. /c/support/*
to the url must contain
setting.
I know that, that’s why I wrote “topics under a single category”. Topics have a url like /t/*
that does not contain category name. So if you add /c/support/*
it shows only on the topic list page not the topics under that category.
Sorry, I totally misread that. I’m afraid that I do not know.
The category is added as a class to the <body>
tag, so you could write CSS that shows or hides the banner depending on the category. For example:
/* Hide banner by default */
.custom-banner-outlet {
display: none;
}
/* Display banner in "General" category */
body.category-general .custom-banner-outlet {
display: block;
}
I’m excited about being able to use this banner but I need to limit its visibility to only certain groups of our users. We use discourse to host an LMS - I am hoping to have this visible to our current students, but not alumni. Is this possible, or is there another way to achieve this?
Thanks so much for any advice.
I think that should be possible using the CSS Classes for Current User's Groups theme component and adding a little display: none;
for the relevant group you wish to hide it from.
Thanks so much. This feels tantilisingly close to what I’m after but sadly I’m completely out of my depth with css. Appreciate the suggestion though!
That’s okay. If you let us know the group name that you want to hide the banner from we can tweak the code to suit your needs and show you where to put it.
For example:
.group-alumni {
.custom-banner-outlet {
display: none;
}
}
/admin/customize/themes
How do we preview the theme without enabling it? I want to be able to experiment without messing up the user experience. We’re on Discourse hosted plan, so we don’t have the ability to run test instances.
I’m hoping that there is a switch or setting that I’ve overlooked.
You can then muck about with this one as much as you like. Others can (in theory) select the Theme but they are very unlikely to unless signposted to it clearly.
Just remember to select the ‘normal’ one when you are done!