Gutenberg: "Table of Contents" Block

Created on 25 Oct 2018  路  18Comments  路  Source: WordPress/gutenberg

Is your feature request related to a problem? Please describe.
In the editor screen of Gutenberg is already a "Table of Contents" (named "Content structure") implemented. It would be nice to have the same feature in the frontend!

Describe the solution you'd like
Make already existing "Content structure" available as "Table of Contents" Block.

Describe alternatives you've considered
Using a "Table of Contents" Plugin like in pre-Gutenberg times.

New Block

Most helpful comment

+1 for a table of contents block. Writing long articles now with several H2 and H3's. It would help summarize the article at the top for readers. Thanks

All 18 comments

There鈥檚 a couple of plugins that has a block like this, I use this one myself: https://wordpress.org/plugins/advanced-gutenberg/

I agree it would be great to have a "Table of Contents" block perhaps similar to below issue "Insert Summery" Block.

https://github.com/WordPress/gutenberg/issues/7115

See #2871, #1760 for more.

+1 for a table of contents block. Writing long articles now with several H2 and H3's. It would help summarize the article at the top for readers. Thanks

There is a block similar to this called Guidepost (although I tried using it on my production site and it crashes when I add a new header after adding the block.)

I had a look at some of the blocks that come with Gutenberg and I never knew that there was a Page Break block. So I think a Table of Contents block would be very useful.

+1 Any news?

No news at all. It is one of the many issues that will stand still until a developer picks it up and creates a Pull Request (PR). When a PR is created with some suggestions then design folks will also add some suggestions and it will go a bit forth and back until a design is settled on. Then the developer will implement the design. Get feedback on code. Then when ready get a final code review and the PR becomes merged. We then get the feature into the Gutenberg plugin and later on into WordPress Core.

In the mean time....well those of use who are not developers just sit and wait, and if we really need this feature before this gets into Gutenberg plugin then will will need to find another plugin solution.

Ps
I just sent a sealed note written with quill ink (not really) to the developer of Guidepost asking him kindly to take a look at this issue. Perhaps he might even create the famous PR to move this issue into another phase where movement begins.

I am so very mistaken....
There is movement. A PR has been created here: https://github.com/WordPress/gutenberg/pull/15426
It is not so far to the finish goal..... (EDIT) The developer of the PR looks to have stopped working on it. I have sent him an e-mail and hope that either he or someone else can pick it up and finish the work needed to get it into core.

@talldan @draganescu @ellatrix Could you help? Table of content is really important.

I'd be happy to try to get the PR working again. What does rebasing involve? Just checking out the branch then merging in the latest master, then fixing what breaks? Should I make a new PR or push to the one that's open? @paaljoachim

That sounds great Sean! @SeanDS

I feel we need the advice of a developer here.
@Soean @youknowriad

Howdy @SeanDS, working on that would be super awesome of you. Rebasing usually woks by checking out that branch and running git rebase master. However, sometimes when the branch is old rebasing will involve solving multiple conflicts for every change applied on top of master and it might become tricky.

Therefore a good "method", if you are taking over an old PR, is to create your own from the current master and simply copy the updates from that PR into yours.

Thanks @draganescu, I copied the changes onto a new branch forked off the current head and made a PR (#21040). Please can people have a look?

Please close this PR. As there is another PR open.
@mapk

Please close this PR. As there is another PR open.
@mapk

@paaljoachim this is an issue, not a PR

Ops... my mistake.... I was jumping around and noticed a few different PR's and bumped into this issue as well. We will close this issue once the Table of Contents Block is merged.
Thanks Sean..:)

It may be helpful, already implemented table of content block https://github.com/maximebj/agb.plugin/tree/master/src/blocks/summary

Perhaps @mahnunchik 's above link will help @SeanDS and @ZebulanStanphill

@paaljoachim I tried out that plugin, but unfortunately it has the same issue my PR used to have where trying to use the Undo button wouldn't work. :disappointed:

Was this page helpful?
0 / 5 - 0 ratings