History: PluginToc
Source of version: 52 (current)
Copy to clipboard
! Plugin Table of Contents Use this ((wiki plugin)) in a page belonging to a structure to display a table of contents listing that page's sub-pages (see also ((Structures))). Nothing will be displayed if the page doesn't have sub-pages. * Used in the structure's 'root' page, a full table of contents for the entire structure will be created. * Used in a sub-page, a chapter table of contents will be created (showing only the sub-pages to that page). !! Parameters {pluginmanager plugin="toc"} !!! Same Page in Multiple Structures Navigating to a page that is included in multiple structures can cause a PluginToc used on that page to behave unexpectedly. In these cases the -+structId+- parameter should be used to set behavior. For example, assume we have one structure called "Full" and one called "Shell" and we have a page called "Examples" that is included in both. In the Full structure, the Examples page has three pages under it called "Example 1", "Example 2" and "Example 3", whereas in the Shell structure there are no pages under the Examples page. If you want the three example pages to show in PluginToc every time the Examples page is brought up, then the -+structId+- parameter should be set to be the -+page_ref_id+- of the Examples page in the Full structure. To determine what this -+page_ref_id+- is, do the following: * Go to -+tiki-admin_structures.php+- * Click on the name of the structure ("Full" in this example) * On the page that comes up, mouse over the page name where PluginToc is being used ("Examples" in this example) * Note the -+page_ref_id+- that is part of the URL when you mouse over the page name * Set the -+structId+- parameter in PluginToc to equal the -+page_ref_id+- noted Now PluginToc on the Examples page will show the three pages underneath it in the Full structure. !!! Using the -+pagename+- parameter Passing the -+pagename+- is useful in (at least) two situations: # When you want to have a master table of contents page of a structure as the last page in the structure. # When you want to include a page (using ((PluginInclude))) with PluginTOC used in another page.%%%If you include the page with the TOC plugin without passing the name of the page to PluginTOC, the table of contents for the page where PluginTOC is included will be shown, instead of showing the TOC for the included page.%%%This is useful for overview/portal pages. !!Examples !!! All levels ''This code:'' {CODE(colors="tiki")} {toc structId="4020" shownum="1"} {CODE} ''Would produce on this site:'' {toc structId="4020" shownum="1"} {REMARKSBOX(type=tip title-Note)} The page "Author Resources" used for the -+pagename+- parameter in the above example is the root page of a structure.{REMARKSBOX} !!! First level only with numerotation ''This code:'' {CODE(colors="tiki")} {toc structId="4020" sortalpha="alpha" mindepth="1"} {CODE} ''Would produce on this site:'' {toc pagename="Author Resources" sortalpha="struct" mindepth="1" maxdepth="1"} !!! From second level and sorted as in the structure ''This code:'' {CODE(colors="tiki")} {toc structId="4020" sortalpha="struct" mindepth="1"} {CODE} ''Would produce on this site:'' {toc structId="4020" sortalpha="struct" mindepth="1"} !!! Only second level and sorted from A to Z ''This code:'' {CODE(colors="tiki")} {toc pagename="Author Resources" sortalpha="alpha" mindepth="1" maxdepth="1"} {CODE} ''Would produce on this site:'' {toc pagename="Author Resources" sortalpha="alpha" mindepth="1" maxdepth="1"} !!! Show description and no numbers ''This code:'' {CODE(colors="tiki" theme="default")}{toc showdesc="1" pagename="Author Resources"} {CODE} Would produce on the main page of a structure (using the ((All the Documentation)) page in this example): {toc showdesc="1" pagename="Author Resources"} Note that in this example, the description is shown first and the title field shown second. If a page has no description field (like in many pages of the structure in this example), only this title will be shown. !! Related pages * ((Auto TOC)) * ((PluginMaketoc)) - makes a table of contents from the headings on a page * ((Module menu)) - can be used to create a menu from a structure !!Alias * (alias(TOC))