[Mediawiki-l] Table of Contents

Brianna Laugher brianna.laugher at gmail.com
Wed Jul 11 01:45:33 UTC 2007


On 11/07/07, Ashley Price (asprice) <asprice at cisco.com> wrote:
> Hi Everyone,
> I was wondering if anyone knows what section of the code and/or where to
> find the code that determines whether or not to generate a Table of
> Contents and then generates the TOC if required?
> I have hopes to actually put the table of contents into a portlet (like
> navigation and the toolbox are)
> -Ashley

TOCs are auto-generated when 4 or more ==headings== exist, I believe.
You can force a TOC to appear on a page by inserting the magic word
__TOC__
(this will put the TOC wherever you put that magic word)

and likewise you can force a TOC to not appear on a page by inserting
the magic word
__NOTOC__

Apparently there is also __FORCETOC__.
From
http://meta.wikimedia.org/wiki/Help:Section#Table_of_contents_.28TOC.29

It's possible for users to turn off TOCs in their preferences - the
'showtoc' option ("Show table of contents (for pages with more than 3
headings)": default is enabled==yes) under 'Misc'.

I think you'll find it tricky to put the TOC into the sidebar like the
navigation and toolbox. You can put it to the side by inserting

<div align="right">
__TOC__
</div>

on each page (or putting this in an appropriate template, and using it
on each page).


cheers
Brianna


-- 
They've just been waiting in a mountain for the right moment:
http://modernthings.org/



More information about the MediaWiki-l mailing list