Table of Contents - Posting Guide

When creating a thread on XboxEra, you have the ability to use a feature called Table of Contents. This allows you as a user to structure your posts in unique and informative ways, and would be particularly useful for Official Threads for new releases and so on.

How does it work?

In a nutshell, it looks for headings in topics which are marked to have a ‘toc’ and if it turns out the current topic is marked, then it takes all the headings and puts them in to the Table of Contents automatically.

Example below:

# heading 1
## heading 2
### heading 3
#### heading 4
##### heading 5
###### heading 6

You’re free to go back and fourth in heading levels, but the order must be correct

# heading 2 
## heading 3
## heading 3
### heading 4
## heading 3
# heading 2

In order for the links in the toc to work, headings must have id attributes. The component will check if the headings already have ids and if they do, then they are respected.

If the headings don’t have ids, then it will generate an id for each heading based on its text (unwanted characters are stripped out).

Once all of that is done, it will also add a link next to each button that links directly to that section.

How do I create a TOC

  1. Write a topic with syntactically correct headings
  2. Click the toc button in the gear menu (only shows up when creating a regular topic - replies and PMs are ignored
  3. Profit.

What happens to the topic progress widget when a topic has a TOC?

As you can probably guess, there’s no space to show both at the same time, so the way this component works is as follows

in a topic with a toc, the topic progress widget is hidden while the first post is on screen, and you see the toc instead.

Once you scroll past the first post, the toc will not scroll with you and the topic progress will be shown instead while you read any replies.

1 Like