Is it possible to change HTML of header and footer and message details on the forum? I have a custom design that need to be implemented and customization features in admin looks very limited. Is it possible to use custom HTML template for header, footer and message thread page? Thanks.
I mean how I can change standard template HTML of discourse pages? Not adding extra HTML, CSS. Is it possible?
Adding custom HTML/CSS via /admin/customize/themes will essentially âchange the standard templateâ.
You can achieve what youâre trying to do this way â yes.
Iâm looking to alter the header as well. Is there any way â preferably without using Javascript â to update the top row (inside <header class="d-header clearfix">
after the title
class) on desktop?
The Envato solution is unacceptable because theyâre wasting a substantial amount of vertical space. We have this huge bar here thatâs completely empty on Desktop browsers!
Thatâd be a great place to put some key links.
So hereâs my solution unless someone bests it:
-
Add extra HTML to my themeâs âAfter Headerâ area for desktop, the div in this example is
<div id="custom-header-links" class="enabled">
-
Run this code in the themeâs â</headâ> area:
<script type="text/javascript"> jQuery( document ).ready(function() { var $nav = $('#custom-header-links'); var $discourseHeaderTitle = $('.d-header .title'); $nav.insertAfter($discourseHeaderTitle); }); jQuery(window).scroll(function () { setTimeout( function() { if ($('.extra-info-wrapper').length && $('#custom-header-links').hasClass('enabled') && jQuery(this).scrollTop() >= 85) { jQuery('#custom-header-links').removeClass('enabled'); jQuery('#custom-header-links')[0].style.display = 'none'; jQuery('#custom-header-links')[0].style.visibility = 'hidden'; } else if (!($('#custom-header-links').hasClass('enabled')) && jQuery(this).scrollTop() < 50) { jQuery('#custom-header-links').addClass('enabled'); jQuery('#custom-header-links')[0].style.display = 'block'; jQuery('#custom-header-links')[0].style.visibility = 'visible'; } }, 10); }); </script>
The first area moves it into place when the document is ready. The second section makes it disappear once the user scrolls far enough, so that it doesnât get in the way of the extra-info-wrapper
class that pops up in the title.
The timeout helps in my browser to wait just a tad while the extra-info-wrapper
appears, since it kind of fades in.
Regarding that second part, yes, itâs executing more JS every time we scroll, which sucks.
Would love feedback if this is going to pull CPU down! Doing it on desktop only for now though.
Itâs pretty full when youâre scrolled down in a topic. The header shows topic title, category, and tags.
Thatâs why my solution is to get rid of the extra custom header stuff when scrolling down. Just working on the best way of doing that.
Iâm trying to generate an event when .extra-info-wrapper
appears and disappears.