Jump to content

Template:AvatarFor: Difference between revisions

From Joepedia
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifexist:{{{1}}}/Avatar|:{{{1}}}/Avatar|{{#ifexist:File:{{{1}}}.png|File:{{{1}}}.png}}}}<noinclude>
<includeonly>{{#if: {{#show: {{{1}}} |?Has Avatar#-= |mainlabel=- }} | [[{{#show: {{{1}}} |?Has Avatar#-= |mainlabel=- }}|link={{{1}}}]]}}</includeonly><noinclude>
== Example ==
== Example ==
E.g:  
E.g:  
   <nowiki>{{AvatarFor|Jelly}}</nowiki>
   <nowiki>{{AvatarFor|Joseph Anderson}}</nowiki>
{{AvatarFor|Jelly}}
{{AvatarFor|Joseph Anderson}}


== Template Data ==
== Template Data ==
Line 10: Line 10:
"params": {
"params": {
"1": {
"1": {
"aliases": [
"user",
"name"
],
"label": "Name",
"label": "Name",
"description": "The name of the person.",
"description": "The name of the person.",
Line 20: Line 16:
}
}
},
},
"description": "Helper template to find a user's Avatar. Looks for their `Username/Avatar` subpage first, then falls back to looking for `Username.png`.",
"description": "Helper template to find a user's Avatar. The user can set this by having an infobox with their avatar shown.",
"format": "inline"
"format": "inline"
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 20:54, 26 January 2025

Example

E.g:

 {{AvatarFor|Joseph Anderson}}

Template Data

Helper template to find a user's Avatar. The user can set this by having an infobox with their avatar shown.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Name1

The name of the person.

Stringrequired