Template:Li: Difference between revisions
Template page
More actions
Added support for background color. Tag: 2017 source edit |
Added support for list depth. Tag: 2017 source edit |
||
| Line 1: | Line 1: | ||
<onlyinclude><includeonly>*{{iconlink|filename={{{1}}}{{#if:{{{g|}}}|_(AV{{{g}}})|}}.png|target={{{1}}}{{#if:{{{g|}}}|#Axiom Verge {{{g}}}|}}|label={{{2|{{{1}}}}}}|border={{#switch:{{{1}}}|#default=|Xedur|Telal|Uruku|Gir-Tab|Vision|Aborted Clone|Ukhu|Sentinel|Xedur Hul|Athetos=1}}|extra={{{x|}}}|color={{{color|}}}}}</includeonly></onlyinclude> | <onlyinclude><includeonly>{{{depth|*}}}{{iconlink|filename={{{1}}}{{#if:{{{g|}}}|_(AV{{{g}}})|}}.png|target={{{1}}}{{#if:{{{g|}}}|#Axiom Verge {{{g}}}|}}|label={{{2|{{{1}}}}}}|border={{#switch:{{{1}}}|#default=|Xedur|Telal|Uruku|Gir-Tab|Vision|Aborted Clone|Ukhu|Sentinel|Xedur Hul|Athetos=1}}|extra={{{x|}}}|color={{{color|}}}}}</includeonly></onlyinclude> | ||
''Like in HTML, "li" stands for "list item".''<br> | ''Like in HTML, "li" stands for "list item".''<br> | ||
This template is to improve display of lists, adding icons to the left of entries.<br> | This template is to improve display of lists, adding icons to the left of entries.<br> | ||
| Line 5: | Line 5: | ||
'''Base syntax:''' <span style="color:#990099;"><nowiki>{{li|Target}}</nowiki></span><br> | '''Base syntax:''' <span style="color:#990099;"><nowiki>{{li|Target}}</nowiki></span><br> | ||
'''Full syntax:''' <span style="color:#990099;"><nowiki>{{li|Target|DifferentLabel|g=GameNumber|x=ExtraText|color=Color}}</nowiki></span> | '''Full syntax:''' <span style="color:#990099;"><nowiki>{{li|Target|DifferentLabel|g=GameNumber|x=ExtraText|color=Color|depth=ListMarkup}}</nowiki></span> | ||
<p style="margin-bottom:0;">'''Required parameters:'''</p> | <p style="margin-bottom:0;">'''Required parameters:'''</p> | ||
| Line 14: | Line 14: | ||
*You can add extra text after the list by adding the parameter x=[...]. | *You can add extra text after the list by adding the parameter x=[...]. | ||
*<small>Rarely, multiple games share an item with the '''same name''' (and use a single page for it, like [[Health Node]]). Depending on the context, the icon should change and the link should target a subsection of that page. If you add the parameter g=#, it will do two things: First, it will append _(AV#) before the .png. Second, the link will target the "Axiom verge #" subsection. For instance, <span style="color:#990099;"><nowiki>{{li|Breach Attractor|g=2}}</nowiki></span> will use [[:File:Breach Attractor_(AV2).png]] instead of [[:File:Breach Attractor.png]] AND will produce this link [[Breach Attractor#Axiom Verge 2|Breach Attractor]] instead of plain [[Breach Attractor]].</small> | *<small>Rarely, multiple games share an item with the '''same name''' (and use a single page for it, like [[Health Node]]). Depending on the context, the icon should change and the link should target a subsection of that page. If you add the parameter g=#, it will do two things: First, it will append _(AV#) before the .png. Second, the link will target the "Axiom verge #" subsection. For instance, <span style="color:#990099;"><nowiki>{{li|Breach Attractor|g=2}}</nowiki></span> will use [[:File:Breach Attractor_(AV2).png]] instead of [[:File:Breach Attractor.png]] AND will produce this link [[Breach Attractor#Axiom Verge 2|Breach Attractor]] instead of plain [[Breach Attractor]].</small> | ||
*You can change the | *Adding parameter color=[...] adds the functionality of [[Template:Color]]. (See that page for info.) | ||
*You can change the depth/styling of the list element with depth=[...]. Default is depth 1 in an unordered list (depth=*). depth=** makes it depth 2. depth=*** for depth 3, etc. You can make ordered lists with depth=#, etc. (See [[wikipedia:Help:List]] for more.) | |||
'''Example:'''<br><span style="color:#990099;"> | '''Example:'''<br><span style="color:#990099;"> | ||
Revision as of 22:30, 6 October 2022
Like in HTML, "li" stands for "list item".
This template is to improve display of lists, adding icons to the left of entries.
(For notes, use Template:note instead.)
Base syntax: {{li|Target}}
Full syntax: {{li|Target|DifferentLabel|g=GameNumber|x=ExtraText|color=Color|depth=ListMarkup}}
Required parameters:
- [Target] must exactly be the name of an existing page. It becomes a link.
- The name of the picture must exactly be [Target].png. (As a standard, the main picture on a page should always be renamed to "{PAGENAME}.png". In case of error, please check if it's the case.)
Optional parameters:
- Like with regular links, you can replace its label (text) by adding a pipe | and replacement text. However, given the purpose of this template, doing so should generally be avoided.
(Note: "Pipe tricks" are not supported and cannot be inside templates.) - You can add extra text after the list by adding the parameter x=[...].
- Rarely, multiple games share an item with the same name (and use a single page for it, like Health Node). Depending on the context, the icon should change and the link should target a subsection of that page. If you add the parameter g=#, it will do two things: First, it will append _(AV#) before the .png. Second, the link will target the "Axiom verge #" subsection. For instance, {{li|Breach Attractor|g=2}} will use File:Breach Attractor_(AV2).png instead of File:Breach Attractor.png AND will produce this link Breach Attractor instead of plain Breach Attractor.
- Adding parameter color=[...] adds the functionality of Template:Color. (See that page for info.)
- You can change the depth/styling of the list element with depth=[...]. Default is depth 1 in an unordered list (depth=*). depth=** makes it depth 2. depth=*** for depth 3, etc. You can make ordered lists with depth=#, etc. (See wikipedia:Help:List for more.)
Example:
{{li|Spiru}}
{{li|Yorchug|x=2}}
{{li|Arachnoptopus|x=5}}
{{li|Streeg|x=2 stuck in inaccessible wall areas}}
{{li|Breach Attractor}}
{{li|Breach Attractor|g=2}}
{{li|Remote Drone|Headcrab|x=Different label example}}
Will produce:
Spiru
Yorchug (2)
Arachnoptopus (5)
Streeg (2 stuck in inaccessible wall areas)
Breach Attractor
Breach Attractor
Headcrab (Different label example)