DiscoTOC - automatic table of contents

I’ve also been trying to figure this out. It’s nice to be distinctive, but table of contents are almost always on the left side of sites, which makes sense given that we read left to right. Is there a way to do this?

1 Like

How can we keep the table of contents on the left and keep the standard discord scrollbar on the right? I have some difficulty getting to the bottom of a post since the scrollbar has changed.

Here is an example:


Hello AntiMetaman,

You can change the direction with css. Add something like this to desktop css section. It should show the DiscoTOC on the left side.

.d-toc-post .d-toc-article{
    flex-flow: row-reverse;

We have a particular use of topics on our community that revealed that this isn’t quite working.

The TOC does show while scrolling through the first post. But, the topic progress bar only shows from the third post on that topic. The first post is very long (hence the TOC), but the second post on this topic is also fairly long. During the whole scroll of that second post, there’s no TOC and no topic progress bar either.

We are currently on a closed staging period, so I can’t provide a link to where this is happening, but I have consistently reproduced this both on latest stable and on tests-passed and the progress bar only shows from the 3rd post of the topic.

1 Like

I experience this all the time myself. Mostly in my case I am missing the admin wrench, but sometimes I also find myself scrolling down, down, down just to get to the replies.

Do you have a suggestion for how it might be improved? I love DiscoTOC and use it everywhere, but the TOC can be quite long, and the progress bar is also quite long. So displaying both at the same time is a bit unwieldy.

I don’t know how this component is implemented or much about the frontend structure of Discourse, so I can only throw in a guess.

Couldn’t the progress bar only be shown a) if more than 1 post in the topic and b) adjust its start to be from the 2nd post (instead of 3rd), but also c) add some comfortable bottom/top margin to one of the two elements to make sure the other remains distant enough (eg 1vh) as to not make it strange looking?

In other words, instead of using the whole 2nd post as a gap, use CSS to allow some room between them (iff there’s more than 1 post).

Again, this might not make any sense at all as I don’t know much about the way this is working atm.


Ultimate apology for bumping this but is there a way to only use the fading aspect of this theme component and not the actual automatic table of content? - What I mean is fading the message.

Is there any plan (or current possible way) to include replies in the table of contents?

I’m unsure how feasible something like this is, but rather than automatically adding replies to the ToC, perhaps there can be a selection in the dropdown to manually add a post and all the headings contained within?
Something like this:

I saw a reply regarding this in April '19, and I apologize if this is a bother and understand if the answer remains the same:

Our forum is a hub for forum games (such as forum mafia) and separating the discussion into multiple topics isn’t really an option. Adding this would be extremely helpful as it allows players to jump to key moments in the game quickly and easily.



( 1946fa3c53 )

After the update, “DiscoTOC” sidebar lost its sticky feature. scrolls up with the page and disappears.

1 Like

I’ve also been thinking about this problem – many reference posts, by a single author, about the same topic, which if put together blow out the single-post character limit. When visiting the topic, you want to jump to a particular reply.

The details of your problem is slightly different from the above - you want to mark important events in the game, such as “Start Day 3 Voting”. Correct?

I think we need custom storage to really solve this problem, which means a plugin and not just a theme component.

1 Like

Can confirm, thanks for the report!

1 Like

Thanks for the quick update. DiscoTOC is working properly now but now there is a problem like the picture.

1 Like

Is that red box supposed to be filled with body text, or is the avatar out of place?

This is likely an issue with the theme you are using.

Noticed the issue, I have an example a little bit more clear : DiscourseConnect - Official Single-Sign-On for Discourse (sso)

The table of contents break the topic body with and there’s a line break between avatar and username/rank

I assume it is related to the new grid display on topics, we have less width available for the table of contents : https://github.com/discourse/discourse/commit/da5841de0b2b60ceaa2f2602d7231e7393a74e66


Continuing the discussion from Discourse New User Guide:

I couldn’t care but notice that on this post your profile picture seems to strangely be all over the place, any ideas why this could happen as I’ve also seen it happen on private communities that I was a part of.


I’ve made a minor update that fixes this — looks like the issue was that longer TOC items would cause the sidebar to be too wide.



Seems fixed, thanks for the quick fix!


Maybe I am misremembering, but I thought that this component used to move with the content after selecting a primary header it would expand to show the secondary headers but would also navigate to the content for the primary header you just clicked.

Now I am noticing if I click a primary header, it takes me to that content, but I lose the rest of the ToC and have to scroll back up to see the secondary headers. Here’s a quick screen recording. Am I going crazy or is this new behavior? :thinking:


Hey Heather,

That’s a known issue (since fixed) related to some changes with made to core Discourse. Let me kick off a deploy of your site to get the fix out.

@Heather_Phillips, deploy complete, this should be working now. Please let us know if not.


Thanks @jomaxro. It’s working now!