Hey, It seems this is time I updated
this very old code !
With DokuWiki greebo, and the default template, if you only want a few pages with the toc collapsed, you can use this trick :
Create an entity named ~~closetoc~~ by editing (or creating) configuration file
conf/entities.local.conf. The line that need to be added is this one :
~~closetoc~~ <script>jQuery(function(){jQuery("\x23dw__toc").children().first().click();});</script>
Then, somewhere in your page source, add
~~closetoc~~ on a line by itself.
When the page is loaded, the toc will collapse.
Drawbacks:
* The toc is initially expanded and when the page is loaded, it collapses. The visual effect may be disturbing.
* the all the code is probably visible in rendered document if you use doku2pdf or doku2odt converters.
I you want to apply this to all the pages in your wiki, you can instead add the javascript code in file
lib/tpl/dokuwiki/footer.html. not tested but should work.
Schplurtz