Template:Section link/doc: Difference between revisions

Content deleted Content added
Pinky sl (talk | contribs)
m sl:Predloga:Section link
text editing
 
(24 intermediate revisions by 14 users not shown)
Line 1:
{{Documentation subpage}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
{{Lua|Module:Section link}}
{{tsh|§l}}
== Usage ==
=== Single section ===
This template is used to generate a link to a certain section of an article that has an appropriate section mark ([[§]]).
This template is used to generate a link to a certain section of a local wiki page and render an appropriate section mark ([[w:§|§]]).
 
Instead of:
<pre>[[Download#What next?|Download § What next?]]</pre>
{{Pre|<nowiki>[[History of IBM#1969: Antitrust, the Unbundling of software and services|History of IBM § 1969: Antitrust, the Unbundling of software and services]]</nowiki>}}
 
...you can write:
{{Pre|<nowiki>{{Section link|History of IBM|1969: Antitrust, the Unbundling of software and services}}</nowiki>}}
 
{{tlx|Section link|Download|What next?}}
which is much shorter and does not require you to search for section mark.
 
...which is much shorter and does not require you to search for the section mark character.
 
Both generate:
: {{Section link|History of IBMDownload|1969: Antitrust, the Unbundling of software andWhat servicesnext?}}
 
=== Multiple sections ===
 
This template may generate consecutive links to several sections of the same page:
{{tlx|Section link|Download|Download from Git instead|What next?}}
 
...will generate:
: {{section link|Download|Download from Git instead|What next?}}
 
=== Suppressing page name ===
Sometimes the page name needs not to appear, e.g. to avoid redundancy and wordiness. For the page on which the template is used, not specifying a page name creates a section link only. The following:
{{tlx|Section link|<nowiki/>|Suppressing page name}}
 
...is the equivalent of:
<pre>[[#Suppressing page name|§ Suppressing page name]]</pre>
 
...and renders as:
: {{section link||Suppressing page name}}
 
For other pages, {{para|nopage|1}} can be used to suppress the page name.
== See also ==
* {{tl|Link section}}: {{tnull|link section|Help:Template|See also}} makes {{link section|Help:template|see also}}
 
Comparison of displayed results:
<includeonly>
* {{tlx|Section link|Help:Templates|Parameters}} → <br
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
/>{{Section link|Help:Templates|Parameters}}
[[Category:Internal link templates]]
* {{tlx|Section link|Help:Templates|Parameters|nopage{{=}}1}} →<br
/>{{Section link|Help:Templates|Parameters|nopage=1}}
* {{tlx|Section link|Help:Templates|Parameters|Anonymous parameters|Numbered parameters}} →<br
/>{{Section link|Help:Templates|Parameters|Anonymous parameters|Numbered parameters}}
* {{tlx|Section link|Help:Templates|Parameters|Anonymous parameters|Numbered parameters|nopage{{=}}1}} →<br
/>{{Section link|Help:Templates|Parameters|Anonymous parameters|Numbered parameters|nopage=1}}
 
== TemplateData ==
[[ja:Template:節リンク]]
{{TemplateData header}}
[[sl:Predloga:Section link]]
<templatedata>
</includeonly>
{
"description": {
"en": "This template is used to generate a link to a certain section of a local wiki page and render an appropriate section mark (§). This template may generate consecutive links to several sections of the same page.",
"cs": "Tato šablona se používá k vygenerování odkazu na určitou sekci místní wiki stránky a vykreslení příslušné značky sekce (§). Tato šablona může generovat po sobě jdoucí odkazy na několik částí stejné stránky."
},
"params": {
"1": {
"label": {
"en": "Page name",
"cs": "Název stránky"
},
"description": {
"en": "Name of the page to which the link must be created. Leave empty to link to the current page. Doing so causes no page name to appear.",
"cs": "Název stránky, na kterou musí být vytvořen odkaz. Nechte prázdné, chcete-li odkazovat na aktuální stránku. Pokud tak učiníte, nezobrazí se žádný název stránky."
},
"type": "wiki-page-name",
"suggested": true
},
"2": {
"label": {
"en": "Section name 1",
"cs": "Název sekce 1"
},
"description": {
"en": "Name of the (first) section to which the link must be created. This parameter is mandatory.",
"cs": "Název (první) sekce, na kterou musí být vytvořen odkaz. Tento parametr je povinný."
},
"type": "string",
"required": true
},
"3": {
"label": {
"en": "Section name 2",
"cs": "Název sekce 2"
},
"description": {
"en": "This template can link to additional sections within one page. You can supply another section name in this field.",
"cs": "Tato šablona může odkazovat na další sekce v rámci jedné stránky. V tomto poli můžete zadat jiný název sekce."
},
"type": "string"
},
"4": {
"label": {
"en": "Section name 3",
"cs": "Název sekce 3"
},
"description": {
"en": "This template can link to additional sections within one page. You can supply another section name in this field.",
"cs": "Tato šablona může odkazovat na další sekce v rámci jedné stránky. V tomto poli můžete zadat jiný název sekce."
},
"type": "string"
},
"5": {
"label": {
"en": "Section name 4",
"cs": "Název sekce 4"
},
"description": {
"en": "This template can link to additional sections within one page. You can supply another section name in this field.",
"cs": "Tato šablona může odkazovat na další sekce v rámci jedné stránky. V tomto poli můžete zadat jiný název sekce."
},
"type": "string"
},
"nopage": {
"label": {
"en": "Suppress page name?",
"cs": "Potlačit název stránky?"
},
"description": {
"en": "If set to a truthy value, suppresses the page name.",
"cs": "Pokud je nastaveno na pravdivou hodnotu, potlačí se název stránky."
},
"default": "0",
"autovalue": "1",
"type": "boolean"
}
}
}
</templatedata>
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Internal link templates{{#translation:}}]]
}}</includeonly>