Loading...
 
Skip to main content

History: PluginAutoTOC

Source of version: 9

Copy to clipboard
            ! PluginAutoTOC

New in ((Tiki23)), this plugin allows to automatically generate a table of contents (TOC) in a wiki page. It permits to leverage the ((Auto TOC)) feature, with more flexibility on a page per page basis.
Its use is relatively simple, you just have to add its syntax code in a wiki page in which headings are located (tag H1 to H6). 

This is different than ((PluginToc)), which is related to Wiki ((Structures)).

!! Parameters
{pluginmanager info="description|parameters|paraminfo" plugin="autotoc" showparamtype="y" showtopinfo="y"}

!! Enabling/Disabling
To enable/disable PluginAutoTOC, go to __Control Panels__ » __Main Features__ » __Edit and Plugins__, then check "Experimental" option in "Preference Filters". Please, see the screenshot below :
{img src="display1784" link="display1784" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC Enabling/Disabling"}

!! Usage
The plugin settings offer more ways to work with the table of contents: make it visible or not, position it on the left or right side of a wiki page, hide the headings of your choice, etc.

!!! Activity
Is the only mandatory parameter. Its possible values are "yes/no", ''yes'' to display the table of contents and ''no'' to not display it.
__Note__: When you add the PluginAutoTOC to a page that contains a table of contents generated by the ((Auto TOC)) feature, the latter will be replaced by the one generated by the PluginAutoTOC.  
__Example__: 
The code below will add a table of contents to the right of a wiki page if there are headings (H1 to H6).
{CODE()}{autotoc activity="yes"}{CODE}

!!! Align
Allows you to add a TOC either to the right, or left, or at the same position where will be placed the Plugin.
__Note__ : By default the table of contents will be added to the right of the page.

!!!! Examples :
1. Align the TOC to the right of wiki page
This code {CODE()}{autotoc activity="yes"}{CODE} or {CODE()}{autotoc activity="yes" align="right"}{CODE}

will produce this :
{img src="display1785" link="display1785" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC Align right"}

2. Align the TOC to the left 
{CODE()}{autotoc activity="yes" align="left"}{CODE}
Using this code above, you will get a result like this one :
{img src="display1786" link="display1786" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC Align left"}

3. Place the TOC in the page
When you give the value "page" to the parameter "align", the table of contents is shown at the place where you put the Plugin in the page. 
{CODE()}{autotoc activity="yes" align="page"}{CODE}
With the previous code, you will have a result like this one:
{img src="display1792" link="display1792" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC Align page"}

!!! Title
This parameter allows to add a title to a table of contents only when the value of the parameter align="page", in other cases the title will not be displayed.
!!!! Example
{CODE()}{autotoc activity="yes" align="page" title="THIS IS A TITLE"}{CODE}
Will produce a result like this :
{img src="display1788" link="display1788" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC parameter title"}

!!! Offset
Adds a space at the top of the table of contents. The value is expressed in pixels. This parameter works only when placing the TOC on the left or right side of the page, not when the TOC is in the content of the page.
!!!! Examples
__1. A table of contents with 150px offset__
{CODE()}{autotoc activity="yes" offset="150"}{CODE} 
The code below will display a table of contents like this one :
{img src="display1789" link="display1789" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC example 150px offset"}

__2. A table of contents with 50px offset__
{CODE()}{autotoc activity="yes" offset="50"}{CODE}
The code below will display a table of contents like this one :
{img src="display1790" link="display1790" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC example 50px offset"}

!!! Levels
Allows to display in the table of contents only the levels of the headings indicated as value of the parameter. When there is more than one, they are separated by ":".
!!!! Example 
{CODE()}{autotoc activity="yes" levels="3"}{CODE} will only display level 3 headings as shown in the screenshot below :
{img src="display1791" link="display1791" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC parameter levels"}

!!! Mode 
This parameter should allow the extension of the headings of the table of contents without scrolling the page. This parameter does not work as expected.
!!!! Syntax :
This code :
{CODE()}{autotoc activity="yes" mode="inline"}{CODE}
Should allow the extension of headings.

And this code :
{CODE()}{autotoc activity="yes" mode="off"}{CODE}
Resets the extension of the titles that occurs only by scrolling the page.

!!! Combinations
You can combine several parameters at once.
!!!! Examples :
This code :
{CODE()}{autotoc activity="yes" align="page" title="Table of contents" levels="3"}{CODE}

will produce a table of contents only with level 3 titles in the wiki page with the title ''Table of contents'' :
{img src="display1787" link="display1787" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC example 1"}

This code:
{CODE()}{autotoc activity="yes" align="left" levels="2:3" offset="130"}{CODE}

will produce a table of contents only with level 2 and 3 headings in the wiki page with a 130px space above :

{img src="display1793" link="display1793" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border" alt="PluginAutoTOC example 2"}

!!! Commits
https://sourceforge.net/p/tikiwiki/code/77744
https://sourceforge.net/p/tikiwiki/code/77745
        

History

Advanced
Information Version
lindon 12
Baraka Kinywa 11
Marc Laporte 10
Marc Laporte 9
Adrien 8
Adrien 7
Adrien 6
Adrien 5
Adrien 4
Adrien 3
Adrien 2
Marc Laporte 1