Changes

Jump to: navigation, search

User:Lakrits/sandbox

330 bytes added, 18:40, 6 January 2015
-
===Syntax===
The template's syntax is
* {{tlc|anchorUser:Lakrits/templatesandbox|anchor1 |anchor2 |anchor3 |…|anchor10 }}
;<big>Example anchors</big>
;<big>Usage</big>
* {{tlc|anchorUser:Lakrits/templatesandbox|<big>'''1'''</big>}}
===Optional parameters===
;<big>Usage</big>
* {{tlc|anchorUser:Lakrits/templatesandbox|1|<big>'''2'''</big>|<big>'''3'''</big>|…|<big>'''10'''</big>}}
===Limitations===
;<big>Section titles</big>
* If the template is added to a section title then the code will appear in the edit summary window when that section is edited, as in "{{code|<nowiki>/*&nbsp;{{anchorUser:Lakrits/templatesandbox|Issues}}Limitations&nbsp;*/&nbsp;New&nbsp;issue</nowiki>}}". Also, when the section is saved, browsers may not return to the section. Consider using {{code|<nowiki><span id="…"></span></nowiki>}} directly, rather than using the anchor template, when in a section title.
;<big>Treat as case-sensitive</big>
|-
| Basic use
| {{tlc|anchorUser:Lakrits/templatesandbox|Example1}} {{code|Target 1}}| {{anchorUser:Lakrits/templatesandbox|Example1}} Target 1
| Can be linked to with {{code|<nowiki>[[#Example1|…]]</nowiki>}} from within the same article, or with {{code|<nowiki>[[Article name#Example1|…]]</nowiki>}} from other articles and from redirects.
|-
| Multiple anchors
| {{tlc|anchorUser:Lakrits/templatesandbox|Example2|Example3|Example4}} {{code|Target 2}}| {{anchorUser:Lakrits/templatesandbox|Example2|Example3|Example4}} Target 2
| Creates three anchors for the same target location that then can be linked to with {{code|<nowiki>[[#Example2|…]]</nowiki>}}, {{code|<nowiki>[[#Example3|…]]</nowiki>}}, or {{code|<nowiki>[[#Example4|…]]</nowiki>}}, respectively.
|-
| Section title <br>(template)
| {{code|<nowiki>==</nowiki>&nbsp;}}{{tlc|anchorUser:Lakrits/templatesandbox|Example5}}{{code|&nbsp;Section title A&nbsp;<nowiki>==</nowiki>}}| {{anchorUser:Lakrits/templatesandbox|Example5}}&nbsp;<span style="font: 21px Fira Sans; text-decoration: underline;">Section title A</span>
| Anchors can be more suitable for inter-article linking than section titles are. In this case, links in the format {{code|<nowiki>[[Article name#Example5]]</nowiki>}} would remain valid even if the section itself was renamed. (Note that the anchor is placed ''before'' the section name; otherwise browsers may hide the section title from view.)
|-
| Section title <br>(HTML)
| {{code|<nowiki>==</nowiki>&nbsp;<nowiki><span id="Example6"></span></nowiki>&nbsp;Section title B&nbsp;<nowiki>==</nowiki>}}
| {{anchorUser:Lakrits/templatesandbox|Custom anchor name}}&nbsp;<span id="Example6"></span><span style="font: 21px Fira Sans; text-decoration: underline;">Section title B</span>
| As noted under [[#Limitations|Limitations]] above, it may be preferable to use direct HTML rather than the template within section titles.
|}
! Case !! What you write !! What you see
|-
| &gt; 10 anchors || {{tlc|anchorUser:Lakrits/templatesandbox|1|2|3|4|5|6|7|8|9|10|11}} || {{anchorUser:Lakrits/templatesandbox|1|2|3|4|5|6|7|8|9|10|11}}
|-
| No&nbsp;parameter || {{tlc|anchorUser:Lakrits/templatesandbox}} || {{anchorUser:Lakrits/templatesandbox}}
|}
3,860
edits

Navigation menu