Difference between revisions of "Template:Disambigentry/sandbox"
GrampaSwood (talk | contribs) m (I think this should work?) |
GrampaSwood (talk | contribs) (Don't mind the way I added display:none because otherwise it won't show up. I will change the way this is done once I find a way to make it number-based rather than having ) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>{{Complex template|user=GrampaSwood}}</noinclude>[[File:{{{icon-override|Item icon {{{1}}}.png}}}|link={{{link|{{{1}}}{{if lang}}}}}|{{{size|64px}}}]] {{#if:{{{link|}}}|[[{{{link}}}|{{{l1|{{{1}}}}}}]]|{{#if:{{{icon-override|}}}|[[{{{link}}}|{{{l1|{{{1}}}}}}]]|{{item link|{{{1}}}}}}}}}<noinclude> | + | <noinclude>{{Complex template|user=GrampaSwood}}</noinclude><includeonly>[[File:{{{icon-override|Item icon {{{1}}}.png}}}|link={{{link|{{{1}}}{{if lang}}}}}|{{{size|64px}}}]]{{#ifeq:{{{whitespace|+}}}|{{{whitespace|-}}}|{{{whitespace}}}|}}{{#if:{{{link|}}}|[[{{{link}}}|{{{l1|{{{1}}}}}}]]|{{#if:{{{icon-override|}}}|[[{{{link|{{{1}}}}}}{{if lang}}|{{{l1|{{{1}}}}}}]]|{{item link|{{{1}}}}}}}}}</includeonly><noinclude> |
{{doc begin}} | {{doc begin}} | ||
== Usage == | == Usage == | ||
Line 8: | Line 8: | ||
== Parameters == | == Parameters == | ||
; 1 | ; 1 | ||
− | : Name of the | + | : Name of the entry, if the {{code|link}} parameter is used then {{code|1}} is not used for the link but only the displayed text. It defaults to using {{tl|item link}}. By default also used for the displayed text, the item icon filename, and the icon's link. |
:;l1 | :;l1 | ||
− | : Optional, used to override the displayed text for the text link. | + | : Optional, used to override the displayed text for the text link. Only use if {{code|link}} is '''not''' used, otherwise the first parameter serves this purpose. |
; icon-override | ; icon-override | ||
− | : Optional, used to override the default item icon (for usage on non-items). | + | : Optional, used to override the default item icon (for usage on non-items). If used, adds {{tl|if lang}} to the end of the {{code|1}} parameter. |
; size | ; size | ||
− | : Optional, | + | : Optional, determines the size of the icon, defaults to 64px. See [[Help:Style guide/Disambiguations#Images]] for some pre-determined images on certain entries (e.g. maps, unusual effects) with their size. |
; link | ; link | ||
: Optional, used when the linked item is not compatible with {{tl|item link}}. Additionally, determines link on the icon and the link next to it. | : Optional, used when the linked item is not compatible with {{tl|item link}}. Additionally, determines link on the icon and the link next to it. | ||
+ | |||
+ | ; whitespace | ||
+ | : Optional, used to put space between the icon and the text to line the text up. Should only contain <code>&<span style="display:none;">aaaaa</span>nbsp;</code> (can be more than one). Useful for when an icon contains no blank space next to it. | ||
== Example == | == Example == | ||
Line 27: | Line 30: | ||
{{tlx|Disambigentry|Bat|2=icon-override=Standard icon RED Bat.png|3=link=Bat/nl|4=size=70px}} generates {{Disambigentry|Bat|icon-override=Standard icon RED Bat.png|link=Bat/nl|size=70px}} | {{tlx|Disambigentry|Bat|2=icon-override=Standard icon RED Bat.png|3=link=Bat/nl|4=size=70px}} generates {{Disambigentry|Bat|icon-override=Standard icon RED Bat.png|link=Bat/nl|size=70px}} | ||
+ | [[Category:Link insertion templates]] | ||
+ | [[Category:Image insertion templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 12:07, 28 January 2025
![]() | This template is very complex. If you have questions about this template, feel free to ask on the IRC. GrampaSwood has offered to maintain this template, you may contact them if you need further assistance. |
Documentation for Disambigentry/sandbox
Usage
{{Disambigentry|1|icon-override=<image name>.jpg/png|size=<number>px|link=<article link>}}
{{de}}
also works!
For usage on disambiguations, automatically adds link + item icon.
Parameters
- 1
- Name of the entry, if the
link
parameter is used then1
is not used for the link but only the displayed text. It defaults to using{{item link}}
. By default also used for the displayed text, the item icon filename, and the icon's link.
- l1
- Optional, used to override the displayed text for the text link. Only use if
link
is not used, otherwise the first parameter serves this purpose.
- icon-override
- Optional, used to override the default item icon (for usage on non-items). If used, adds
{{if lang}}
to the end of the1
parameter.
- size
- Optional, determines the size of the icon, defaults to 64px. See Help:Style guide/Disambiguations#Images for some pre-determined images on certain entries (e.g. maps, unusual effects) with their size.
- link
- Optional, used when the linked item is not compatible with
{{item link}}
. Additionally, determines link on the icon and the link next to it.
- whitespace
- Optional, used to put space between the icon and the text to line the text up. Should only contain
&
(can be more than one). Useful for when an icon contains no blank space next to it. nbsp;
Example
{{Disambigentry|Bat}}
generates Bat.
{{Disambigentry|icon-override=Standard icon RED Bat.png|link=Bat/nl|size=70px}}
generates Bat