# Adding DiscoTOC to Published Pages

**URL:** https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402
**Category:** Feature
**Tags:** page-publishing, disco-toc
**Created:** [May 23, 2020, 2:54pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402 "2020-05-23T14:54:55Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [May 23, 2020, 2:54pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/1 "2020-05-23T14:54:55Z")

</div>

This is great, thank you!

This makes me think, @j.jaffeux, that Discourse plugins are applied to published pages (e.g., footnotes) but theme components are not (e.g., table of contents). It might be tricky to implement since some components are not necessarily useful in the context of pages, but ToCs are definitely useful. Any chance we can have it?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [August 11, 2020, 1:42pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/2 "2020-08-11T13:42:44Z")

</div>

It seems that theme components are only partially applied?  
CSS is, but scripts in `/head` are not.  
Or am I overlooking something?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [August 17, 2020, 3:39pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/3 "2020-08-17T15:39:10Z")

</div>

at the moment page publishing is not designed to support theme components or anything using plugin api and especially decorateCooked.

Not saying this is impossible, but we didn’t work on it and at this point I dont know if we will.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [August 17, 2020, 8:16pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/4 "2020-08-17T20:16:12Z")

</div>

> [@j.jaffeux](#):
>
> anything using plugin api and especially decorateCooked.

I can understand that, after all there are no Ember components on those pages.

My question is just about some simple jQuery code (`document.ready()`) and things like GA, GTM. The simple and plain Javascript stuff, so to say. It would be sufficient if the `</head>` and `<footer>` sections of the theme component would be inserted as-is.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [August 17, 2020, 8:52pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/5 "2020-08-17T20:52:27Z")

</div>

Maybe I didn’t try it, but wouldn’t that cause error with other themes trying to load code which is not available?

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [September 14, 2020, 4:33pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/6 "2020-09-14T16:33:50Z")

</div>

This is a wonderful feature! Are there any plans to support [DiscoTOC](https://meta.discourse.org/t/discotoc-automatic-table-of-contents/111143) in published pages?

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [September 14, 2020, 5:05pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/7 "2020-09-14T17:05:33Z")

</div>

> [@Page Publishing](https://meta.discourse.org/t/page-publishing/151971/90):
>
> > [@alehandrof](#):
> >
> > This is a wonderful feature! Are there any plans to support [DiscoTOC](https://meta.discourse.org/t/discotoc-automatic-table-of-contents/111143) in published pages?
> 
> Not in the near future.

Thanks for the quick confirmation.

FWIW, my need is to create several pages worth of related content. Ideally, I’d want separate pages, linked by some kind of navigation. AFAICT, this doesn’t seem possible with the current implementation. I requested the TOC as a workaround – having all the content on one page, navigable by the TOC.

The TOC would be great to have eventually, but in my case what I was really looking for is separate, but inter-connected pages. I’ll find another solution for the moment. But is something like this in the cards at all for the future?

---

<div class="post-metadata">

### Author: ![sbernhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sbernhard/32/208186_2.png) [@sbernhard](https://meta.discourse.org/u/sbernhard)
#### Post date: [December 14, 2020, 8:25am UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/8 "2020-12-14T08:25:43Z")

</div>

Is there a plan, that the TOC is also visible for published pages? Page publishing was a feature introduced in discourse 2.5? This would be a huge benefit of this theme component!

---

<div class="post-metadata">

### Author: ![craigconstantine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/craigconstantine/32/511195_2.png) [@craigconstantine](https://meta.discourse.org/u/craigconstantine)
#### Post date: [June 9, 2021, 11:57am UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/9 "2021-06-09T11:57:24Z")

</div>

Using the table-of-contents theme component on published pages would be awesome… That’s been mentioned a few times in this topic.

Any thoughts on if that could happen?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 23, 2023, 3:06pm UTC](https://meta.discourse.org/t/adding-discotoc-to-published-pages/246402/11 "2023-08-23T15:06:15Z")

</div>

This is unlikely, as published pages don’t have access ton many JS features and there are currently no plan to extend this.
