Template:CharLink: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Square up the icon)
(Updated documentation)
Line 1: Line 1:
<includeonly><span style="display: inline-block; vertical-align: middle; border: hidden; border-radius:50%; overflow: hidden; width: {{{w|25}}}px; height: {{{w|25}}}px">{{Icon|{{#if:{{{icon|}}}|{{{icon}}}|Portrait {{{1}}}.png}}|{{{w|25}}}|link={{{1}}}}}</span> [[{{{1}}}|{{{2|{{{1}}}}}}]] {{#ifexist: File:{{#if:{{{icon|}}}|{{{icon}}}|Portrait {{{1}}}.png}} | | {{Main namespace only|[[Category:Pages with missing charlink portraits]]}} }}</includeonly><noinclude>This template will let you make character icons. So far it only supports those who have {{InfoBlob|File:Portrait {Name}.png}}.
<includeonly><span style="display: inline-block; vertical-align: middle; border: hidden; border-radius:50%; overflow: hidden; width: {{{w|25}}}px; height: {{{w|25}}}px">{{Icon|{{#if:{{{icon|}}}|{{{icon}}}|Portrait {{{1}}}.png}}|{{{w|25}}}|link={{{1}}}}}</span> [[{{{1}}}|{{{2|{{{1}}}}}}]] {{#ifexist: File:{{#if:{{{icon|}}}|{{{icon}}}|Portrait {{{1}}}.png}} | | {{Main namespace only|[[Category:Pages with missing charlink portraits]]}} }}</includeonly><noinclude>
{{see also|Template:MdCharLink|Template:LgCharLink}}
This template creates a link to a character with an accompanying portrait icon. It expects an icon at {{InfoBlob|File:Portrait {Name}.png}}, but this icon file can be overridden with the {{InfoBlob|icon}} field.


{{CharLink|Lae'zel}}
This template has an associated maintenance category at [[:Category:Pages with missing charlink portraits]].


{{CharLink|Jaheira}}
== Examples ==
{|class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{CharLink|Lae'zel|Bae'zel}}</nowiki></code>
| {{CharLink|Lae'zel|Bae'zel}}
|-
| <code><nowiki>{{CharLink|Auntie Ethel|icon=Portrait Ethel Human.png}}</nowiki></code>
| {{CharLink|Auntie Ethel|icon=Portrait Ethel Human.png}}
|-
| <code><nowiki>{{CharLink|Volo|w=40}}</nowiki></code>
| {{CharLink|Volo|w=40}}
|-
| <code><nowiki>{{CharLink|Unknown Character}}</nowiki></code>
| {{CharLink|Unknown Character}}
|}


{{CharLink|Volo|Volo (Alias)|w=40}}
== Template data ==
 
<templatedata>
{{CharLink|Unknown Character}}
{
 
"params": {
You can set the icon manually: {{InfoBlob|<nowiki>{{CharLink|Spectator|icon=Edward-vanderghote-beholder.webp}}</nowiki>}}
"1": {
 
"description": "Name of the character",
{{CharLink|Spectator|icon=Edward-vanderghote-beholder.webp}}
"required": true,
"label": "name",
"type": "wiki-page-name"
},
"2": {
"description": "Alias for the link text",
"label": "alias",
"type": "string"
},
        "icon": {
"description": "Specify a different icon",
"label": "icon",
"type": "wiki-file-name"
},
        "w": {
"description": "Width (and height) of icon",
"label": "width",
            "default": "25",
"type": "number"
}
},
"description": "Inserts a link for a character.",
"paramOrder": [
"1",
"2",
        "icon",
        "w"
]
}
</templatedata>
[[Category:Templates]]
[[Category:Templates]]
[[Category:Icon templates]]
</noinclude>

Revision as of 01:03, 10 July 2024

This template creates a link to a character with an accompanying portrait icon. It expects an icon at File:Portrait {Name}.png, but this icon file can be overridden with the icon field.

This template has an associated maintenance category at Category:Pages with missing charlink portraits.

Examples

Code Result
{{CharLink|Lae'zel|Bae'zel}} Lae'zel Bae'zel
{{CharLink|Auntie Ethel|icon=Portrait Ethel Human.png}} Auntie Ethel Auntie Ethel
{{CharLink|Volo|w=40}} Volo Volo
{{CharLink|Unknown Character}} File:Portrait Unknown Character.png Unknown Character

Template data

Inserts a link for a character.

Template parameters

ParameterDescriptionTypeStatus
name1

Name of the character

Page namerequired
alias2

Alias for the link text

Stringoptional
iconicon

Specify a different icon

Fileoptional
widthw

Width (and height) of icon

Default
25
Numberoptional