Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
How can I show the TOC of another page?
Avatar
delu #1
Member since Nov 2016 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: How can I show the TOC of another page?
Hi,

Is it possible to embed an automatically-generated table of contents/heading tree of one page into another page (preferably with working anchor links)?


Thanks.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 3586 posts · Location: Canada
Group memberships: Global Moderators, Members
Show profile · Link to this post
The table of contents for each page is recreated with each page change and saved in the meta file for that page.  So it would be a straight forward matter to get the table of contents, but you would need a plugin to insert it into the current page.  I've checked the plugins and while there are several (some outdated) that handle tocs, none of them seem relevant to your case.  However, if you have someone who can do some programming for you, these other plugins might help to show you the way to go.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
turnermm (Moderator) #3
Member since Oct 2009 · 3586 posts · Location: Canada
Group memberships: Global Moderators, Members
Show profile · Link to this post
This got me thinkin and I put together a plugin which you might find useful:

https://www.dokuwiki.org/plugin:tocselect
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 3586 posts · Location: Canada
Group memberships: Global Moderators, Members
Show profile · Link to this post
I did a bit more work on this and it can now be placed either in the sidebar or anywhere on the page, where it takes the place of the default toc.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2017-03-30, 06:40:46 (UTC +02:00)