Template:Lead to body link: Difference between revisions
More actions
Created page with "<noinclude> <templatestyles src="lead to body link/styles.css" /> {{lead to body link|TemplateData|foobar}} {{documentation}} </noinclude> <span style="text-decoration: underline dashed"><span class="text-color">{{{2}}}</span></span>" |
No edit summary |
||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
<templatestyles src="lead to body link/styles.css" /> | <templatestyles src="Template:lead to body link/styles.css" /> | ||
{{lead to body link|TemplateData|foobar}} | {{lead to body link|TemplateData|foobar}} | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
[[#{{{1}}}|<span style="text-decoration: underline dashed"><span class="text-color">{{{2}}}</span></span>]] | [[#{{{1}}}|<span style="text-decoration: underline dashed"><span class="text-color">{{{2}}}</span></span>]] |
Latest revision as of 22:01, 15 March 2025
This template uses TemplateStyles: |
Usage
This template provides an easy way to create section links that are differentiable from generic wikilinks.
{{lead to body link|TemplateData|foobar}}
becomes foobar.
This template accepts two unnamed parameters:
- 1 - the name of the section to be linked to
- 2 - the text to display
Note that this template can only link to sections that are on the same page.
Example
Instead of [[#TemplateData|foobar]]
which returns foobar, or {{section link||TemplateData}}
which returns TemplateData (unsuitable for a lead section), {{lead to body link|TemplateData|foobar}}
returns foobar.
lblink or l2b can be used as aliases:
{{lblink|TemplateData|foo}}
, {{l2b|TemplateData|bar}}
returns foo, bar.
TemplateData
This template provides an easy way to create section links that are differentiable from generic wikilinks.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Page name | 1 | The name of the section to be linked to | String | required |
Label | 2 | The text to display | String | required |
[[#{{{1}}}|{{{2}}}]]