This TechNet Wiki article shows you how to automatically add a table of contents to your Wiki article by using the "[ TOC ]" tag. You need to include headers in your article, and then the TOC tag places a table of contents that will link down to the corresponding
section of your article.
If any headers have the zero character, "0", you must edit them in the HTML editor. The header text can have zeros, but after the article is saved, you must edit the <a name> tag in the header line to remove or replace all zero characters. If there
are any zero characters, the header line will not appear in the Table of Contents.
If any headers are duplicates, you must edit them in the HTML editor. The header text can be duplicated in the article, but the <a name> tags must be unique. Modify the <a name> tags to ensure uniqueness.
To demonstrate the problem with duplicate headers, check the example header lines below in the next section. They are designed to demonstrate the hierarchy of headers in the resulting Table of Contents at the top of this article. However, notice that three
of the headers have the text "Sample Header 3". If you test the Table of Contents at the top of this article, you will see that all three of the corresponding entries in the TOC link to the same point in this article. All three headers have the same
<a name> tag.
If any headers have leading digits, such as "1" or "2", these will be ignored in the automatically generated
<a name> tag when the article is saved. This means that the <a name> tag may not be unique. For example, if your article has the header line "1.2 References", and later the header line "3.1 References", the
<a name> tags will not be unique. You must modify the <a name> tags in the HTML to make them unique, so the TOC will work properly. Leading digits in the <a name> tag will be ignored, but digits are allowed anywhere else in the name. For example, you
could modify the <a name> tags in the example to be <a name="References_1_2"> and
Note: Spaces and periods must be replaced by underscores.
Important Note: If your article's TOC is not showing up as expected, see below to get help and
fix your TOC!
Return to Top
Return to Top
As you saw in the section above, your headers determine the hierarchy of the TOC (how much they are indented). Your headers automatically build out <a name=example></a> tags into the HTML, and the TOC feature uses those tags along with header number in order
to determine the hierarchy in the TOC.
For example, on this article, "Feature Requests for TechNet and MSDN Profiles and Social Platform
Tools" (yes, some interesting articles exist on TechNet Wiki), I used Heading 3 headers to create the top sections of each platform tool (such as Wiki, Forums, Blogs, Profiles, and Gallery). Then I used a Heading 2 to make the "Completed/Closed Requests"
section at the bottom. Even though it's a higher heading, the H3s were listed first, and so the H2 below them is listed at the same hierarchical level as the H3s (this is a good thing; trust me). Then under my H2 ("Completed/Closed Requests"), I included several
H3 sections for each social platform tool. This time, because those H3s were listed below the H2 section, they were indented to the right in the TOC hierarchy:
So it's a fantastic and smart system! And that's one advantage that the
TechNet Wiki TOC has over other Wiki TOCs... you control the hierarchy and how many levels you want! This easy to add feature is excellent for users of all skill levels! The TOC will make your WIKI stand out from other WIKI's!
There is no automatic way to link back to the top of your article. You can create a new anchor at the top of your article, write text, and then link to the top of your article (and then copy and paste that into the bottom of each section of your article).
A faster way to do that is to copy this text and paste it in one time in your article (at the bottom of a section):
Return to Top
Click anywhere on the link text, click the "Insert Link or Anchor" icon on the toolbar, and update the article name in the "URL" text box (you can get it from your browser's address bar). For example, you'll want to replace "3329" with your article's ID or
Once you modified your "Return to Top" link, copy and paste it anywhere in your article to keep those changes you made.
If you prefer having your link go up to the top text of your article (not the top of the page), then you'll need to create the anchor on your page first (click at the top, click the "Insert Link or Anchor" icon on the toolbar, click the Anchor tab, type "Top"
in the Name text box, and click OK), and then change your link to point to that (click anywhere on the link text, click the "Insert Link or Anchor" icon on the toolbar, choose "Top" from the Existing Anchor list box, and then click OK).
Return to Top
If you're having trouble to get the TOC right, please check this article:
And if you're still having trouble:
Great article, Peter! Very much needed!
That's one of my favorite features in Word for documentation. Glad to see it made its way to TechNet Wiki!
very cool. What is the easiest way to create jumps back to the TOC so they can navigate back and foth from the TOC to a specific section in the article, rinse, repeat?
Okay I added a "Back to Top Link" section about the fastest manual process for that.
Very useful! I'll keep it in mind.
As you know, we're going to localize TechNet Wiki.
I was thinking about a small problem in the translation system: the "Table of Contents" header will not be translated automatically, but it will always be displayed in English language.
I can't get the toc to work correctly in this article:
Three headers are missing from the toc: "What is AD FS 2.0?", "Install AD FS 2.0", and "Manage AD FS 2.0".
If not all headers show up in the TOC, then carefully check your HTML code. The most likely cause of missing TOC items is a mismatch in HTML tags
Yes, it would be good to have a language flag for this parameter ([toc:hu-HU], [toc:pt-BR] etc.), or a display-text property.
Very useful !