Custom Discourse banners

The last thing I expected to be asked about was how we enabled the cycling banners here on the forum, which was a good spot by some that it isn’t a default Discourse option. In the spirit of open source, my late-night hacky script and style are here for sharing. :smiley:

We currently have just two headers, but the component is written to allow us to add as many as we want to the carousel using data-* custom attributes. I’ve split the stylings and the script the way I have, so all a moderator needs to do to add a new banner is copy and paste an existing one and change the ID, link and image. Presto :pinched_fingers:t4:

This is just a custom theme component, not an installed plugin. If you are a Discourse admin, you can do the same.

Complete the sections for Common CSS, Head (just a script tag) and After Header (the HTML markup).

So, for @haitheredavid and the others who have asked, my version is here:

3 Likes

keeping everything open source so I can copy + :spaghetti: my way to happiness. Thank you @jonathon! :pray:

3 Likes