How to disable display of table of contents in a wiki

How to disable display of table of contents in a wiki

by Maurits Lamers -
Number of replies: 1

Hi all,

Because of a nasty error in the way the table of contents seems to work I want to disable the table of contents generation for a wiki page. I have been searching in both configuration and documentation, but I didn't find anything.

The reason I want to disable the TOC is that it doesn't allow for the same text to appear more than once and generates visible errors. The kind of layout I have is:

instrumentname

handling

other things

instrumentname

handling

other things

 etc.

Anyone an idea how to either remove the TOC or the errors?

thanks in advance!

cheers

Maurits

Average of ratings: -
In reply to Maurits Lamers

Re: How to disable display of table of contents in a wiki

by John White -

Hi Maurits,

Disabling this wont help fix the error but it will hide it away. I'm not a Wiki expert, but if you go into:

/mod/wiki/parser/markups/wikimarkup.php and search for protected function generate_header, then a few lines below that you have: 

if ($level < 4) {

If you change this to:

if ($level < 1) {

...the Table of Contents will disappear from ALL wikis. It should come back if you reverse the changes.

Regards,  John