Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Li: Difference between revisions

Template page
Xhamon (talk | contribs)
Bugfix attempt.
Tag: 2017 source edit
Xhamon (talk | contribs)
This edit fixes appended text (not using "x" parameter) appearing on new lines. "li" tag is only needed when there's an indent. (Appended text will still be broken when there's an indent.)
Tag: 2017 source edit
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly>* <span style="display:inline-block; height:32px; width:32px; text-align:center;">[[File:{{{1}}}.png|frameless|link={{{1}}}{{#if:{{{g|}}}| #Axiom Verge {{{g}}}|}}|32x32px]]</span> [[{{{1}}}{{#if:{{{g|}}}| #Axiom Verge {{{g}}}{{!}}{{{1}}}|}}]] {{#if: {{{x|}}}|({{{x}}})|}}</includeonly></onlyinclude>
<onlyinclude><includeonly>{{{type|*}}}{{#tag:{{#if:{{{indent|}}}|li|span}}|{{iconlink|filename={{{1}}}{{#if:{{{g|}}}|_(AV{{{g}}})|}}.png|target={{{1}}}{{#if:{{{g|}}}|&#35;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|}}}}}|style=margin-left:{{#expr:{{{indent|0}}}*40}}px;}}</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.
This template is to improve display of lists, adding icons to the left of entries.<br>
(For notes, use [[Template:note]] instead.)


Syntax: <span style="color:#990099;"><nowiki>{{li|Item}}</nowiki></span> or <span style="color:#990099;"><nowiki>{{li|Item|x=something}}</nowiki></span>
'''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|type=ListType|indent=#}}</nowiki></span>


*[Item] must exactly be the name of an existing page. It becomes a link.
<p style="margin-bottom:0;">'''Required parameters:'''</p>
*The name of the picture must exactly be [Item].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.)
*{{color|txt=purple|<nowiki>Target</nowiki>}} must exactly be the name of an existing page. It becomes a link.
*You can add extra text after the list by adding the parameter x=[...].
*The name of the picture must exactly be {{color|txt=purple|<nowiki>Target</nowiki>}}.png. (As a standard, the main picture on a page should always be renamed to "{{color|txt=firebrick|<nowiki>{{PAGENAME}}</nowiki>}}.png". In case of error, please check if it's the case.)
*<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 link should target a subsection of that page. If you add the parameter g=#, the link will target the "Axiom verge #" subsection. For instance, <span style="color:#990099;"><nowiki>{{li|Health Node|g=2}}</nowiki></span> will produce this link [[Health Node#Axiom Verge 2|Health Node]] instead of plain [[Health Node]].</small>
<p style="margin-bottom:0;">'''Optional parameters:'''</p>
*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.<br><small>(Note: "[[wikipedia:Help:Link#Automatic_conversion_of_wikitext_with_the_pipe_trick|Pipe tricks]]" are not supported and cannot be inside templates.)</small>
*You can add extra text after the list by adding the parameter {{color|txt=purple|<nowiki>x=[...]</nowiki>}}.
*<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, {{color|txt=purple|<nowiki>{{li|Breach Attractor|g=2}}</nowiki>}} 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>
*Adding parameter {{color|txt=purple|<nowiki>color=[...]</nowiki>}} changes the background color via [[Template:Color]]. (See that page for info.)
*You can change the type of the list element with {{color|txt=purple|<nowiki>type=[...]</nowiki>}}. Default is "unordered list" ({{color|txt=purple|<nowiki>type=*</nowiki>}}). {{color|txt=purple|<nowiki>type=#</nowiki>}} makes it an ordered list. (See [[wikipedia:Help:List]] for more types.) <small>Types with depths (e.g.: {{color|txt=purple|<nowiki>type=##</nowiki>}}) are supported, but it puts a big margin/separation between each change of depth. Using indents (the next parameter) is usually preferred.</small>
*List depth can be changed with {{color|txt=purple|<nowiki>indent=#</nowiki>}}. Default is 0. Use {{color|txt=purple|<nowiki>indent=1</nowiki>}} for sublevel 1, etc.


Example:<br><span style="color:#990099;">
'''Example:'''<br><span style="color:#990099;">
<nowiki>{{li|Spiru}}</nowiki><br>
<nowiki>{{li|Spiru}}</nowiki><br>
<nowiki>{{li|Yorchug|x=2}}</nowiki><br>
<nowiki>{{li|Yorchug|x=2}}</nowiki><br>
<nowiki>{{li|Arachnoptopus}}</nowiki><br>
<nowiki>{{li|Arachnoptopus|x=5}}</nowiki><br>
<nowiki>{{li|Scorpiant}}</nowiki><br>
<nowiki>{{li|Streeg|x=2 stuck in inaccessible wall areas}}</nowiki><br>
<nowiki>{{li|Pliaa|x=5}}</nowiki><br>
<nowiki>{{li|Breach Attractor}}</nowiki><br>
<nowiki>{{li|Streeg|x=2 stuck in inaccessible wall areas}}</nowiki></span>
<nowiki>{{li|Breach Attractor|g=2}}</nowiki><br>
<nowiki>{{li|Remote Drone|Headcrab|x=Different label example}}</nowiki></span>


Will produce:
<p style="margin-bottom:0;">Will produce:</p>
{{li|Spiru}}
{{li|Spiru}}
{{li|Yorchug|x=2}}
{{li|Yorchug|x=2}}
{{li|Arachnoptopus}}
{{li|Arachnoptopus|x=5}}
{{li|Scorpiant}}
{{li|Pliaa|x=5}}
{{li|Streeg|x=2 stuck in inaccessible wall areas}}
{{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}}

Latest revision as of 10:10, 12 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|type=ListType|indent=#}}

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=[...] changes the background color via Template:Color. (See that page for info.)
  • You can change the type of the list element with type=[...]. Default is "unordered list" (type=*). type=# makes it an ordered list. (See wikipedia:Help:List for more types.) Types with depths (e.g.: type=##) are supported, but it puts a big margin/separation between each change of depth. Using indents (the next parameter) is usually preferred.
  • List depth can be changed with indent=#. Default is 0. Use indent=1 for sublevel 1, etc.

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: