On 10/07/07, Ashley Price (asprice) asprice@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)
The Parser is responsible for generating the table of contents, using magic words present on the page to override this behaviour, e.g. __TOC__, __FORCETOC__ and __NOTOC__. Tables of content are generated for all users, and suppressed for those users who don't want them using CSS.
The actual table is generated in Parser::replaceHeadings(), although there are various other little bits of code dotted around which handle the above magic words, e.g. setting placeholders if the position is being overridden, or if a table is being suppressed for the whole page, etc.
Rob Church