This is the template test cases page for the sandbox of Template:Section link. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
Lua code | Wikitext code | Result |
---|---|---|
mSectionLink('Paris','Architecture')
|
{{section link|Paris|Architecture}}
|
Paris § Architecture |
{{section link/sandbox|Paris|Architecture}}
|
Paris § Architecture | |
mSectionLink('Paris',{'Architecture','Culture'})
|
{{section link|Paris|Architecture|Culture}}
|
Paris §§ Architecture and Culture |
{{section link/sandbox|Paris|Architecture|Culture}}
|
Paris §§ Architecture and Culture | |
mSectionLink('Paris',{'Architecture','Culture','Sport'})
|
{{section link|Paris|Architecture|Culture|Sport}}
|
Paris §§ Architecture, Culture, and Sport |
{{section link/sandbox|Paris|Architecture|Culture|Sport}}
|
Paris §§ Architecture, Culture, and Sport | |
mSectionLink('Paris',{'Architecture','Culture','Sport'},{nopage=true})
|
{{section link|Paris|Architecture|Culture|Sport|nopage=yes}}
|
§§ Architecture, Culture, and Sport |
{{section link/sandbox|Paris|Architecture|Culture|Sport|nopage=yes}}
|
§§ Architecture, Culture, and Sport |
Case 1: no parameters
{{Section link}}
{{Section link}}
{{Section link}}: required section parameter(s) missing
{{Section link}}: required section parameter(s) missing
Case 2: only one parameter
{{Section link|Section}}
{{Section link}}
{{Section link}}: required section parameter(s) missing
{{Section link}}: required section parameter(s) missing
Case 3: article and section
{{Section link|Article|Section}}
{{Section link}}
Case 4a: only section (Null article parameter)
Case 4b: only section (No article parameter at all)
Case 4c: only section (No article parameter at all and nopage set)
{{Section link|2=Section |nopage=yes}}
{{Section link}}
Case 5: article and 2 sections
Case 6: article and 3 sections
{{Section link|Article|Section 1|Section 2|Section 3}}
{{Section link}}
Case 7: article and 4 sections
{{Section link|Article|Section 1|Section 2|Section 3|Section 4}}
{{Section link}}
Case 8: article and 5 sections
Case 9a: 5 sections only (null article parameter)
{{Section link||Section 1|Section 2|Section 3||Section 5}}
{{Section link}}
Case 9b: 5 sections only (no article parameter and 5th positional parameter)
Case 9c: 5 sections only (no article parameter, 5th positional parameter, and nopage set)
{{Section link|2=Section 1 |3=Section 2 |4=Section 3 |6=Section 5 |nopage=yes}}
{{Section link}}
Case 10 (misuse): only positional parameters 3, 4 and 6
{{Section link|||Section 2|Section 3||Section 5}}
{{Section link}}
Case 11 (misuse): only positional parameters 4 and 6
{{Section link||||Section 3||Section 5}}
{{Section link}}
Case 12: subpage links
Case 13: display title
{{Section link|Wikipedia:Page name|Section|display=:wikipedia: _ ''p''a<sup>g</sup><sub>e</sub>_'''''n''a'''m<sup><sup>e</sup></sup>}}
{{Section link}}
Case 14: non-matching display title
{{Section link|Wikipedia:Page name|Section|display=WP:PNAME}}
{{Section link}}
Lua error: Display title "WP:PNAME" was ignored since it is not equivalent to the page's actual title.
Lua error: Display title "WP:PNAME" was ignored since it is not equivalent to the page's actual title.
Case 15: anchor in title
{{Section link|Article#Section}}
{{Section link}}
Case 16: anchor in title and section
Case 17: multiple sections plus display title
{{Section link|Article|Section 1|Section 2|display=''Article''}}
{{Section link}}