Templates download/TOClimit: Difference between revisions

(Created page with "<div class="downloadarea"> <span class="getButton">Download</span> 450x450px</div> This template can be inte...")
 
No edit summary
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==


#Insert the template ''TOClimit'' with VisualEditor.
#'''Add''' the template from Visual Editor.[[File:TOClimit standard toc.png|alt=Selecting the TOClimit template|center|thumb|350x350px|Selecting the TOClimit template]]
#Enter the number of heading levels you want to show on the page (1-4): 1=only main headings, .... , 4= main headings and 3 levels of subheadings
#'''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=Headings limit|center|thumb|350x350px|Headings limit]]
#'''Save the page.''' The table of contents is now shown with your custom settings.
{{Messagebox|boxtype=note|icon=|Note text=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=}}


==Pages included in the import==
===Parameters===
The xml import creates the following files in your wiki:
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
|1
|<span style="color: rgb(32, 33, 34)">Removes numbering when set to 1</span>
|-
|notitle
|1
|<span style="color: rgb(32, 33, 34)">Removes title when set to 1</span>
|-
|noborder
|1
|<span style="color: rgb(32, 33, 34)">Removes border when set to 1</span>
|-
|fontlarge
|1
|
{| class="wikitable sortable" style="width:1120px;"
| style="vertical-align:top;box-sizing:border-box;border:1px solid rgb(162, 169, 177);font-size:1em;padding:8px;" |Sets size to match regular content size
|}
|}
 
'''Example:'''
<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|alt=Standard TOC|Standard TOC
File:TOClimit custom.png|alt=Custom TOC| Custom TOC
</gallery>


*Template:TOClimit
__NOTOC__
*Template:TOClimit/styles.css


__NOTOC__
__NOTOC__

Revision as of 11:20, 10 February 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:

  1. Select file and choose HW-TOClimit.xml.
  2. Enter an Interwiki prefix. Since this field is required, simply add hw (for hallowelt).
  3. Keep the selection Import to default locations.
  4. 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

  1. Add the template from Visual Editor.
    Selecting the TOClimit template
    Selecting the TOClimit template
  2. Enter the level of headings you want to show. Sie die Anzahl der gewünschten Überschriften-Ebenen ein (z.B. 1).
    Headings limit
    Headings limit
  3. Save the page. The table of contents is now shown with your custom settings.
Note: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.


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 1 Removes numbering when set to 1
notitle 1 Removes title when set to 1
noborder 1 Removes border when set to 1
fontlarge 1
Sets size to match regular content size

Example:

{{TOClimit|limit=1|nonum=|notitle=1|noborder=1|fontlarge=1}}

Output before and after:





To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions