Is it possible to disable topic title in header?


(Joe) #1

In topic-list pages the header looks like this:

No matter how much scrolling you do, it stays the same.

However, in topic pages, once you scroll down enough, the header content changes to the small logo and the topic title and extra info like so:

This is a wonderful feature that I like very much :heart: but would like to move to another location in the page.

I still need to learn how to do that and it will possibly take a bunch of time, so for now I would just like to disable it and keep the header constant.

So, no matter how much scrolling you do in topics, the header should stay the same (large logo and no topic info)

Any pointers? :grin:


(Joe) #2

Here’s the reason why I need to disable this function for now:

I’m using a very thin header and the title + additional info do not fit in there.

Here’s the header in the topic-list pages (scrolled down)

And here’s the header in the topic page (also scrolled down):

And this is as close as I got to finding the function:


#3

Try this in the </head> tab of your theme:

<script type="text/discourse-plugin" version="0.8.13">
    api.modifyClass('component:discourse-topic', {
        showTopicInHeader() {
            return false;
        }
    })
</script>

It might have side-effects though, so make sure you navigate around the site to see if it breaks anything.


Thin header component
(Joe) #4

:grin: amazing!

That’s exactly what I needed. The best part is that everything else seems to be working just fine!

Thank you so much! :blush: