Template:Section link/testcases

Lua

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

Invalid usage

Not enough params

Case 1: no parameters
{{Section link}}

{{Section link}}

{{Section link}}: required section parameter(s) missing

{{Section link/sandbox}}

{{Section link}}: required section parameter(s) missing

Case 2: only one parameter
{{Section link|Article}}

{{Section link}}

{{Section link}}: required section parameter(s) missing

{{Section link/sandbox}}

{{Section link}}: required section parameter(s) missing

Valid usage

One section

Case 3: article and section
Case 4a: only section (Null article parameter)
{{Section link||Section}}

{{Section link}}

§ Section

{{Section link/sandbox}}

§ Section

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}}

§ Section

{{Section link/sandbox}}

§ Section

Case 15: anchor in title

Multiple sections

Case 5: article and 2 sections
{{Section link|Article|Section 1|Section 2}}

{{Section link}}

Article §§ Section 1​ and Section 2

{{Section link/sandbox}}

Article §§ Section 1 and Section 2

Case 6: article and 3 sections
{{Section link|Article|Section 1|Section 2|Section 3}}

{{Section link}}

Article §§ Section 1, Section 2, and Section 3

{{Section link/sandbox}}

Article §§ Section 1, Section 2, and Section 3

Case 7: article and 4 sections
{{Section link|Article|Section 1|Section 2|Section 3|Section 4}}

{{Section link}}

Article §§ Section 1, Section 2, Section 3, and Section 4

{{Section link/sandbox}}

Article §§ Section 1, Section 2, Section 3, and Section 4

Case 8: article and 5 sections
{{Section link|Article|Section 1|Section 2|Section 3|Section 4|Section 5}}

{{Section link}}

Article §§ Section 1, Section 2, Section 3, Section 4, and Section 5

{{Section link/sandbox}}

Article §§ Section 1, Section 2, Section 3, Section 4, and Section 5

Case 9a: 5 sections only (null article parameter)
{{Section link||Section 1|Section 2|Section 3||Section 5}}

{{Section link}}

§§ Section 1, Section 2, Section 3, and Section 5

{{Section link/sandbox}}

§§ Section 1, Section 2, Section 3, and Section 5

Case 9b: 5 sections only (no article parameter and 5th positional parameter)
{{Section link|2=Section 1 |3=Section 2 |4=Section 3 |6=Section 5}}

{{Section link}}

Template:Section link/testcases §§ Section 1, Section 2, Section 3, and Section 5

{{Section link/sandbox}}

Template:Section link/testcases §§ Section 1, Section 2, Section 3, and Section 5

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}}

§§ Section 1, Section 2, Section 3, and Section 5

{{Section link/sandbox}}

§§ Section 1, Section 2, Section 3, and Section 5

Case 16: anchor in title and section
{{Section link|Article#Section 1|Section 2}}

{{Section link}}

Article §§ Section 1​ and Section 2

{{Section link/sandbox}}

Article §§ Section 1 and Section 2

Case 18: custom conjunction word
{{Section link|2=Section 1 |3=Section 2 |conjunction=or}}

{{Section link}}

Template:Section link/testcases §§ Section 1​ and Section 2

{{Section link/sandbox}}

Template:Section link/testcases §§ Section 1 or Section 2

Display title

Case 13: display title
{{Section link|Wikipedia:Page name|Section|display=:wikipedia: _ ''p''a<sup>g</sup><sub>e</sub>_'''''n''a'''&#109;<sup><sup>e</sup></sup>}}

{{Section link}}

:wikipedia: _ page_name § Section

{{Section link/sandbox}}

:wikipedia: _ page_name § Section

Case 17: multiple sections plus display title
{{Section link|Article|Section 1|Section 2|display=''Article''}}

{{Section link}}

Article §§ Section 1​ and Section 2

{{Section link/sandbox}}

Article §§ Section 1 and Section 2

Invalid

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.

{{Section link/sandbox}}

Lua error: Display title "WP:PNAME" was ignored since it is not equivalent to the page's actual title.

Misc

Case 12: subpage links
{{Section link|../|Usage}}

{{Section link}}

../ § Usage

{{Section link/sandbox}}

../ § Usage

Misuse

Gaps in params

Case 10 (misuse): only positional parameters 3, 4 and 6
{{Section link|||Section 2|Section 3||Section 5}}

{{Section link}}

§§ Section 2, Section 3, and Section 5

{{Section link/sandbox}}

§§ Section 2, Section 3, and Section 5

Case 11 (misuse): only positional parameters 4 and 6
{{Section link||||Section 3||Section 5}}

{{Section link}}

§§ Section 3​ and Section 5

{{Section link/sandbox}}

§§ Section 3 and Section 5

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.