Difference between revisions of "Template:ItemLink"
Jump to navigation
Jump to search
Bumsakalaka (talk | contribs) |
Bumsakalaka (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
| imageandtext | | imageandtext | ||
| imageframe | | imageframe | ||
| image = {{#if: {{{imagehtml|}}} | {{{imagehtml}}} | {{#if: {{{image|}}} | [[File:{{{image}}}|{{CalculateSize|size={{{size|45px}}}|ratio={{{ratio|1}}} }}|{{#ifeq:{{{variant}}}|imageframe|thumb{{!}}none|frameless}}|link={{#ifeq:{{{linkname}}}|empty|{{#if:{{{anchor|}}}|<nowiki>#</nowiki>{{{anchor|}}}}}|{{#urldecode:{{{{{linkname}}}|anchor={{{anchor|}}}|linkonly=true|edition={{{edition|}}}|variant={{{linkvariant|}}}}} }} }}|{{#ifeq:{{{variant}}}|imageframe|{{#switch: {{{formating}}} | | image = {{#if: {{{imagehtml|}}} | {{{imagehtml}}} | {{#if: {{{image|}}} | {{#ifeq:a|a| [[File:{{{image}}}|{{CalculateSize|size={{{size|45px}}}|ratio={{{ratio|1}}} }}|{{#ifeq:{{{variant}}}|imageframe|thumb{{!}}none|frameless}}|link={{#ifeq:{{{linkname}}}|empty|{{#if:{{{anchor|}}}|<nowiki>#</nowiki>{{{anchor|}}}}}|{{#urldecode:{{{{{linkname}}}|anchor={{{anchor|}}}|linkonly=true|edition={{{edition|}}}|variant={{{linkvariant|}}}}} }} }}|{{#ifeq:{{{variant}}}|imageframe|{{#switch: {{{formating}}} | ||
| lowercase = {{lc: {{{text|}}} }} | | lowercase = {{lc: {{{text|}}} }} | ||
| strong | | strong | ||
| bold = '''{{{text|}}}''' | | bold = '''{{{text|}}}''' | ||
| {{{text|}}} }} }} ]] | ''Missing <code>image</code>'' }} }} | | {{{text|}}} }} }} ]] | {{#switch: {{{formating}}} | ||
| lowercase = {{lc: {{{text|}}} }} | |||
| strong | |||
| bold = '''{{{text|}}}''' | |||
| {{{text|}}} }} ''Image [[File:{{{image}}}]] not exists''{{Category|Editor Manual - Image not exists}}{{Category|Editor Manual - Image not exists - {{{image}}}}} }} | ''Missing <code>image</code>'' }} }} | |||
| linkonly = {{urlencode:{{{{{linkname}}}|anchor={{{anchor|}}}|linkonly=true|edition={{{edition|}}}|variant={{{linkvariant|}}}}}|WIKI}} | | linkonly = {{urlencode:{{{{{linkname}}}|anchor={{{anchor|}}}|linkonly=true|edition={{{edition|}}}|variant={{{linkvariant|}}}}}|WIKI}} | ||
| text = {{#switch: {{{formating}}} | | text = {{#switch: {{{formating}}} | ||
Line 36: | Line 40: | ||
<section begin="params" /> | <section begin="params" /> | ||
* <code>variant</code> Optional. [ <code>abbr</code> | <code>image</code> | <code>imageandtext</code> | <code>imagelink</code> | <code>imagename</code> | <code>linkonly</code> | <code>short</code> | <code>text</code> ] Some pieces can have defined <code>short</code> variant of name Castle vs Castle token or <code>abbr</code>. When <code>image</code> then instead of name of item is showed required image. | * <code>variant</code> Optional. [ <code>abbr</code> | <code>image</code> | <code>imageandtext</code> | <code>imagelink</code> | <code>imagename</code> | <code>imageframe</code> | <code>linkonly</code> | <code>short</code> | <code>text</code> ] Some pieces can have defined <code>short</code> variant of name Castle vs Castle token or <code>abbr</code>. When <code>image</code> then instead of name of item is showed required image. | ||
* <code>edition</code> Optional. For expansions with edition depend rule pages, like <code>C1</code>, <code>C2</code>, <code>C3</code>, <code>WE1</code>, <code>WE2</code>, <code>WE3</code> | * <code>edition</code> Optional. For expansions with edition depend rule pages, like <code>C1</code>, <code>C2</code>, <code>C3</code>, <code>WE1</code>, <code>WE2</code>, <code>WE3</code> | ||
* <code>imagehtml</code> Optional, but required when <code>variant=image</code> and <code>image</code> is not set or empty. Wiki name for image. | * <code>imagehtml</code> Optional, but required when <code>variant=image</code> and <code>image</code> is not set or empty. Wiki name for image. | ||
Line 106: | Line 110: | ||
|- | |- | ||
| <code><nowiki>{{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Hills And Sheep C2 Tile L.jpg|anchor=Examples|variant=imageframe|size=50px}}</nowiki></code> || {{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Hills And Sheep C2 Tile L.jpg|anchor=Examples|variant=imageframe|size=50px}} | | <code><nowiki>{{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Hills And Sheep C2 Tile L.jpg|anchor=Examples|variant=imageframe|size=50px}}</nowiki></code> || {{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Hills And Sheep C2 Tile L.jpg|anchor=Examples|variant=imageframe|size=50px}} | ||
|- | |||
| <code><nowiki>{{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Image {{CURRENTTIMESTAMP}}.jpg|anchor=Examples|variant=imageframe|size=50px}}</nowiki></code> || {{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Image {{CURRENTTIMESTAMP}}.jpg|anchor=Examples|variant=imageframe|size=50px}} | |||
|- | |- | ||
|} | |} | ||
[[File:Hills And Sheep C2 Tile L.jpg|link=#Examples]] | [[File:Hills And Sheep C2 Tile L.jpg|link=#Examples]] | ||
</noinclude> | </noinclude> |
Latest revision as of 14:12, 7 May 2024
{{{{{linkname}}}|anchor=|edition=|variant=|logo=hide|text= }}
Description
Generating link to Item used for Template:Feature, Template:Figure and Template:Piece to simplifier of original templates.
Params
variant
Optional. [abbr
|image
|imageandtext
|imagelink
|imagename
|imageframe
|linkonly
|short
|text
] Some pieces can have definedshort
variant of name Castle vs Castle token orabbr
. Whenimage
then instead of name of item is showed required image.edition
Optional. For expansions with edition depend rule pages, likeC1
,C2
,C3
,WE1
,WE2
,WE3
imagehtml
Optional, but required whenvariant=image
andimage
is not set or empty. Wiki name for image.image
Optional, but required whenvariant=image
andimagehtml
is not set or empty. Wiki name for image.size
Optional. Size of image, default45px
linkname
Required. [empty
|TemplateLinkName
]. Expansion link name likeInnCathedralsLink
. Whenempty
value, then anchor to current page is generated invariant=image
linkvariant
Optional. Variant for expansion link likeII
forlinkname=RiverLink
to link to River II.anchor
Optional. Anchor to requested pagetext
Optional, but required whenvariant
is notimage
.formating
Optional. Formating style for text, likelowercase
editionwarning
Optional. Whentrue
and parameteredition
is not set or empty, generate error. Use is on edition related items (like image and links).
Examples
Please not use direct ItemLink template, it's only for internal purposes of templates like Template:Figure, Template:Piece, Template:Feature.
Code | Output |
---|---|
{{ItemLink|linkname=BridgesCastlesBazaarsLink|edition=C1|variant=short|text=Castle}} |
Castle |
{{ItemLink|linkname=BridgesCastlesBazaarsLink|edition=C2|variant=short|text=Castle Token}} |
Castle Token |
{{ItemLink|linkname=BridgesCastlesBazaarsLink|edition=C2|variant=short|text=Castle Token|anchor=castles}} |
Castle Token |
{{ItemLink|linkname=BridgesCastlesBazaarsLink|edition=C2|variant=image|image=Token_Castle_C2.png|size=x60px}} |
|
{{ItemLink|linkname=BridgesCastlesBazaarsLink|edition=C2|variant=imageandtext|text=Castle Token|image=Token_Castle_C2.png|size=x60px}} |
Castle Token |
{{ItemLink|linkname=BridgesCastlesBazaarsLink|edition=C2|variant=image|image=Token_Castle_C2.png|size=x60px|ratio=0.5}} |
|
{{ItemLink|linkname=BaseGameLink|text=Example}} |
Example |
{{ItemLink|linkname=BaseGameLink|text=Example for plain text|variant=text}} |
Example for plain text |
{{ItemLink|linkname=BaseGameLink|text=Example|editionwarning=true}} |
Example Missing edition
|
{{ItemLink|linkname=BaseGameLink|text=Example|variant=image}} |
Missing image
|
{{ItemLink|linkname=BaseGameLink|text=Example|image=Token_Castle_C2.png|variant=imagename}} |
Token Castle C2.png |
{{ItemLink|linkname=BaseGameLink|text=Example|image=Token_Castle_C2.png|variant=imagelink}} |
File:Token Castle C2.png |
{{ItemLink|linkname=RiverLink|linkvariant=II|text=River II link}} |
River II link |
{{ItemLink|linkname=HillsSheepLink|image=Hills And Sheep C2 Tile L.jpg|variant=image}} |
|
{{ItemLink|linkname=HillsSheepLink|image=Hills And Sheep C2 Tile L.jpg|variant=imageandtext|text=Sheep token}} |
Sheep token |
{{ItemLink|linkname=BaseGameLink|text=Highwaymen|edition=C2|formating=lowercase}} |
highwaymen |
{{ItemLink|linkname=PeasantRevoltsLink|variant=image|imagehtml=<div style="display:inline-block; position:relative; white-space: nowrap;">
<div style="display:inline-block;">{{Feature|name=PeasantRevoltCitiesSymbol|variant=image}}</div>
<div style="display:inline-block; position: relative; left: -10px;">
<div style="display:inline-block; position:relative;">
<div style="display:inline-block;">{{Feature|name=PeasantRevoltRoadsSymbol|variant=image}}</div>
<div style="display:inline-block; position: relative; left: -10px;">{{Feature|name=PeasantRevoltMonasteriesSymbol|variant=image}}</div>
</div>
</div>}} |
|
{{ItemLink|linkname=empty|text=Highwaymen|image=Hills And Sheep C2 Tile L.jpg|anchor=Examples|variant=image}} |
|
{{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Hills And Sheep C2 Tile L.jpg|anchor=Examples|variant=imageframe|size=50px}} |
|
{{ItemLink|linkname=BaseGameLink|text=Highwaymen|image=Image {{CURRENTTIMESTAMP}}.jpg|anchor=Examples|variant=imageframe|size=50px}} |