Created page with "<div class="downloadarea"> <span class="getButton">Download</span> 450x450px</div> This template can be inte..." |
No edit summary Tag: 2017 source edit |
||
(7 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<span class="getButton">[[Media:HW-TOClimit.zip|Download]]</span> | <span class="getButton">[[Media:HW-TOClimit.zip|Download]]</span> | ||
[[File:template-download-TOClimit.png|450x450px]]</div> | [[File:template-download-TOClimit.png|450x450px|alt=Template data dialog example]]</div> | ||
This template can be integrated into a page using the Visual Editor ''Insert>Template'' link. It makes it possible to limit the heading levels that are shown in the Table of Contents of a wiki page. | This template can be integrated into a page using the Visual Editor ''Insert>Template'' link. It makes it possible to limit the heading levels that are shown in the Table of Contents of a wiki page. | ||
==Importing the template== | ==Importing the template== | ||
Line 15: | Line 15: | ||
The template is now available in your wiki. | The template is now available in your wiki. | ||
==Pages included in the import== | |||
The xml import creates the following files in your wiki: | |||
* Template:TOClimit | |||
*Template:TOClimit/styles.css | |||
==Usage== | ==Usage== | ||
# | #'''Add''' the template from Visual Editor.[[File:TOClimit standard toc.png|alt="Add a template" dialog|center|thumb|350x350px|Selecting the TOClimit template]] | ||
#Enter the | #'''Enter''' the level of headings you want to show. Sie die Anzahl der gewünschten Überschriften-Ebenen ein (z.B. <code>1</code>).[[File:TOClimit 1en.png|alt=Template settings dialog|center|thumb|550x550px|Headings limit 1]] | ||
#'''Save the page.''' The table of contents is now shown with your custom settings. | |||
{{Messagebox|boxtype=note|icon=|Note text={{Bsvs|bsvTo=4.1}}If you need to make adjustments to the parameters after saving the template, switch to source editing mode. Since the table of contents is not shown in visual aditing mode, the template will not be shown in this mode.|bgcolor=}} | |||
===Parameters=== | |||
The following customizations are possible: | |||
{| class="wikitable" style="" | |||
|+ | |||
!Parameter | |||
!Possible value | |||
!Description | |||
|- | |||
|limit | |||
|1, 2, 3, 4 | |||
|<span style="color: rgb(32, 33, 34)">Limits heading levels (up to level 4). If the value is <code>2</code>, the TOC is 2 levels deep</span> | |||
|- | |||
|nonum | |||
|0, 1 | |||
|<span style="color: rgb(32, 33, 34)">Removes numbering when set to 1</span> | |||
|- | |||
|notitle | |||
|0, 1 | |||
|<span style="color: rgb(32, 33, 34)">Removes title when set to 1</span> | |||
|- | |||
|noborder | |||
|0, 1 | |||
|<span style="color: rgb(32, 33, 34)">Removes border when set to 1</span> | |||
|- | |||
|fontlarge | |||
|0, 1 | |||
|Sets size to match regular content size when set to 1 | |||
|- | |||
|inline | |||
|0, 1 | |||
|Shows the items in a row (only possible if limit=1) | |||
|} | |||
== | === Examples === | ||
<syntaxhighlight lang="text"> | |||
{{TOClimit|limit=1|nonum=|notitle=1|noborder=1|fontlarge=1}} | |||
</syntaxhighlight> | |||
'''Output before and after:''' | |||
<gallery widths="250" heights="250"> | |||
File:TOClimit before.png|Before | |||
File:TOClimit custom.png|After | |||
</gallery>Main levels of the TOC displayed in one row:<syntaxhighlight lang="text"> | |||
{{TOClimit|limit=1|nonum=1|notitle=1|noborder=0|fontlarge=0|inline=1}} | |||
</syntaxhighlight> | |||
[[File:TOClimit inline.png|alt=Display of the main level of the TOC in one row|center|thumb|750x750px|Inline-TOC]] | |||
__NOTOC__ | |||
__NOTOC__ | __NOTOC__ |
Latest revision as of 07:54, 16 August 2023
This template can be integrated into a page using the Visual Editor Insert>Template link. It makes it possible to limit the heading levels that are shown in the Table of Contents of a wiki page.
Importing the template
The import file is included in the archive file HW-TOClimit.zip. Unpack the zip file first.
On the page Special:Import follow these steps:
- Select file and choose HW-TOClimit.xml.
- Enter an Interwiki prefix. Since this field is required, simply add hw (for hallowelt).
- Keep the selection Import to default locations.
- Click Sie Upload file... .
The template is now available in your wiki.
Pages included in the import
The xml import creates the following files in your wiki:
- Template:TOClimit
- Template:TOClimit/styles.css
Usage
- Add the template from Visual Editor.
Selecting the TOClimit template - Enter the level of headings you want to show. Sie die Anzahl der gewünschten Überschriften-Ebenen ein (z.B.
1
).Headings limit 1 - Save the page. The table of contents is now shown with your custom settings.
Parameters
The following customizations are possible:
Parameter | Possible value | Description |
---|---|---|
limit | 1, 2, 3, 4 | Limits heading levels (up to level 4). If the value is 2 , the TOC is 2 levels deep
|
nonum | 0, 1 | Removes numbering when set to 1 |
notitle | 0, 1 | Removes title when set to 1 |
noborder | 0, 1 | Removes border when set to 1 |
fontlarge | 0, 1 | Sets size to match regular content size when set to 1 |
inline | 0, 1 | Shows the items in a row (only possible if limit=1) |
Examples
{{TOClimit|limit=1|nonum=|notitle=1|noborder=1|fontlarge=1}}
Output before and after:
-
Before
-
After
Main levels of the TOC displayed in one row:
{{TOClimit|limit=1|nonum=1|notitle=1|noborder=0|fontlarge=0|inline=1}}
