dfuentes
(Daniel Fuentes)
September 1, 2020, 3:19pm
1
I’m new to discourse, so I apologize if this is something that is easily done, however, I can’t seem to find where I can define the text that I want to appear beside our logo in the header of our discourse page.
Within the red box in the header is where I’d ideally like to add text saying ‘Community Forums’ or something of the sort:
How can I go about getting this done?
Thanks in advance for any and all feedback!
Johani
(Joe)
September 1, 2020, 4:10pm
2
Hey Daniel
You can use something like this to add text next to the header logo on your site
<script type="text/discourse-plugin" version="0.8">
api.decorateWidget("home-logo:after", helper => {
const titleVisible = helper.attrs.minimized;
const headerText = "Text you want to add"; // <--- change this text
if (!titleVisible) {
return api.h("span.header-text", headerText);
}
});
</script>
You’d add it in the header section of your theme / component. You can read more about the Discourse theme system here
This is a crash course in Discourse theme basics. The target audience is everyone who is not familiar with Discourse themes. If you’ve already used Discourse theme / theme components, this guide is probably not something you need to read.
What are themes and theme components?
A theme or theme component is a set of files packaged together designed to either modify Discourse visually or to add new features.
Let’s start with themes.
Themes
In general, themes are not supposed to be compatible wi…
3 Likes