Translations of this page?:

Table of Contents (TOC)

DokuWiki creates a Table of Contents from the Section headers automatically. By default only Section headers of the levels 1 to 3 are considered for the TOC (See toptoclevel and maxtoclevel on how to tune this)). A TOC is only displayed if at least three sections exist.

The last sentence expresses what I find rather disturbing: Either there should be a ToC (i.e. on all pages) or not1). The current default behaviour, however, results in a confusing effect since sometimes there is a ToC and sometimes there isn't. So when a user changes a page by following a link not only the overall layout of the page changes2) but the amount of information as well3). I consider this quite a drawback for both accessibility and consistency as well as usability. So whenever I install a DokuWiki version I have to patch it to remove that annoying behaviour. I'd strongly recommend to change that default behaviour.
Matthias Watermann 2007-08-05 18:14
Having a TOC with one or two entries is rather stupid IMHO. — Andreas Gohr 2007-08-30 11:22
Well, it might look “stupid” at first glance. But besides the points mentioned above you should consider that the second headline (of whatever level) in a page can be way down (i.e. requiring some scrolling). And since the whole purpose of a ToC is to provide kind of shortcut to reach certain parts of the current page even a ToC with only two entries can improve a page's usability.
Judging by the emails I've got asking for a patch there are quite a lot people feeling the same way as outlined above. If you really want to deprive your readers of that shortcut comfort you could introduce another config-var (like mintocentries in symmetry to maxtoclevel) which would allow to setup DokuWiki's actual behaviour without the need to patch the source code.
Matthias Watermann 2007-08-30 15:03
Getting users to notice the existance of a TOC for the page only is a great way to make information accessible way faster than reading the entire page. You can see how you can implement and make things easier for users. To get users attention to the TOC I created an animated arrow that shows up next to the page. I would like to have something like this idea to originate automatically as part of the TOC.http://www.gwtp.org
Julio Ortiz 2007-08-30 15:03

TOC Default State

It would be nice to have the option to have the TOC default to being collapsed. I've been digging through code to try and find a way that I can override it. I've gotten so far as to identify the toc.style.display variable but my attempts at setting the value to 'none' have not worked out so far. I'm not especially fluent in javascript, so that doesn't help. — Carl Manzi 2007-09-21 21:38

I was also looking for this. I ended up adding the command “js_runonstart('toggleToc()');” to the “lib/exe/js.php” file, in the section ”// init stuff”. This causes the toggle function to run immediately after loading the page. Not extremely pretty, but functional. NOTE: It changes this for *all* pages.. — Steven Koutstaal 2007/10/24 10:46 CET

1) depending on the global overall setting
2) since sometimes there is a ToC box and sometimes not
3) because sometimes there is a ToC and sometimes there isn't
 
wiki/toc.txt · Last modified: 2007/10/24 10:46 by 80.126.125.100
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate