Hi John, I asked the same type of question about a week ago and the most useful response I received was as follows:
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
Hope this helps, Ashley
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Getzke, John Sent: Monday, July 23, 2007 1:53 PM To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] TOC code
Hello,
I am interested in hacking our sidebar to dynamically draw content from the TOC on certain pages. Does anyone know where the code is that generates the TOC on each wiki article?
Thanks,
John Getzke Jgetzke@ptc.com
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l