DiscoTOC - automatic table of contents

(Stephen) #24

That’s a static page rather than a topic. Are we sure they’re supported at this stage?

May be why.


(David Kingham) #25

You are correct, I used this on the built in FAQ page which was working while I was editing it, but once you go to the faq page it does not work :frowning: you may want to add a more clear note about this @Johani , I didn’t know the FAQ wasn’t a ‘standard layout’ and it’s confusing when it works while editing the FAQ. Any idea if this will ever work for the FAQ or should I abandon this?


(Stephen) #26

@tobiaseigen your /faq redirects to the topic, not the page.

@davidkingham Those pages pull in the contents of a topic, but aren’t topics themselves. It may come in a future update but if it’s not working for now it’s probably easier to remove.


(Tobias Eigen) #27

@davidkingham maybe the answer is to do what I did and start a topic for your FAQ and set the link for it in the admin. Works for me! :seedling:


(Stephen) #28

You lose the navigation that usually sits atop by doing this:

And get a bunch of topic UI that doesn’t really make sense for a static document:

Hard to see the point in doing that when it may be fixed, no?


(Anna Berns) #29

I love this!!!

Any chance you could add it as an option for replies as well?

Thanks so much :slight_smile:


(Tobias Eigen) #30

I think this could be quite interesting for long procedure topics, especially if the topic had a seamless table of contents that included all headings in all posts in the topic. This is likely unreasonable to implement because of the continuous scroll feature. Not all posts in the topic are loaded, especially for long topics.

Alternatively, and I know this is a pipe dream, it would be super sweet to see a :pencil2: pencil link next to titles for those with permission to edit the post, next to the existing :link: link icon. When selected, a composer window would open to edit just that section.

My use case: I have some long topics (e.g. list topics, FAQs, or procedures) and it can be time consuming to make even a small edit because when you hit edit you get a wall of markdown text to scroll through to find just the bit you want to edit.


(Mindaugas Bartusevičius) #31

BUG :bug: the links near h1 title not clicable …


(Mathijs V) #32

TOC was only working in replies, now it somehow works and I can’t reproduce the problem. Leaving the details below just in case someone gets the same problem.

I fixed it for myself by removing all theme components from the theme and then re-adding them.

Thanks for this plugin it is awesome!

Vague problem

Hi there,

I get this really strange behaviour on two different discourse instances.

Instance A:

  • Installed plugin
  • It didn’t work, frustrated me
  • Looked in the reply, TOC button appeared there
  • “Fixed” the plugin by changing a line of code
    condition: !composerController.get("model.canCategorize")
    condition: composerController.get("model.canCategorize")
  • It worked

Instance B:

  • Installed the edited version
  • It didn’t work, except for replies
  • Installed the original version
  • It worked

My mind is blown. How can this plugin work on one instance and not on the other?

I will try to find out what causes this.

Edit: Should have done this earlier, but it seems there is another theme component that conflicts with this one.

1 Like

(Joffrey Jaffeux) #33

I pushed a fix for this yesterday, so if you update to latest Discourse you shouldn’t have any issue.


(Mathijs V) #34

Thanks! Thought I was getting crazy there for a minute :slight_smile:



The latest update was breaking the pages for us, was hiding user icon top right, site header top left and obscuring topic contents, it was running alongside slick gallery, tile gallery, tag icons for info :+1:


(Joffrey Jaffeux) #36

Can you try to update to latest revision I just pushed a change, should fix it.

1 Like

(Pad Pors) #37


hi, is it possible to remove the topic time-line when the theme is active, at least for the first post?

1 Like

(B Iggy) #38

+1. With the latest commit, the post timeline is now visible, which should not for the whole TOC area/post.

On Mobile, the TOC Button is even overlapping (broken) @joffreyjaffeux


1 Like

(Joffrey Jaffeux) #39

Yes I reverted the whole commit, the method used is deprecated, but what is supposed to be equivalent has clearly a slightly different behavior. I think the current code is probably relying on some edge case making it kind of instable, will have to dig more to remove the deprecation.


(Leonardo Zanoni Pedrini) #40

Same happened to me.

Added a text between link and header, and now it works

1 Like

(Tobias Eigen) #41

After a month, I’m still greatly enjoying using DiscoTOC in my community, and have gotten very positive feedback from my users. Thanks again for creating it! :sunflower:

Some of the feedback I gave above has not been answered… I’d be interested in hearing your thoughts, esp on the spacing between titles in the toc, and toning down the anchor link styling.


(Joe) #42

There’s lots of great feedback in this topic which I haven’t had a chance to implement. I’ve been meaning to do that but I just never got the chance to do it.

I’ll try to put some time aside to fix the issues with this component and implement some of the suggested changes soon™

Thank you for your patience :+1:


(Tobias Eigen) #44

Thanks, @Johani! I look forward to seeing where you are able to take this theme component.

FYI, today I noticed that, on my site at least, the “Insert Table of Contents” is no longer showing up on the composer options. Not sure if this is because of a recent update to DiscoTOC or something else. Copying and pasting the TOC html into the topic manually still works.

1 Like