Template:Infobox Ferret: Difference between revisions

Replace the code with gorasuhl solution
Gorasuhl (talk | contribs)
cleaned unneccessary parameter from 'Infobox header', moved mugshot to a sub-template to make wikitext look more clean/easier ro read. Fixed issue not using PAGENAME as default value.
Line 2: Line 2:
{{#vardefine:noCategories|{{#if:{{{noCategories|}}}|{{{noCategories|}}}|{{#if:{{NAMESPACE}}|1}}}}}}
{{#vardefine:noCategories|{{#if:{{{noCategories|}}}|{{{noCategories|}}}|{{#if:{{NAMESPACE}}|1}}}}}}
{{Infobox start|Ferret}}
{{Infobox start|Ferret}}
{{Infobox header
{{Infobox header| name = {{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}}}
| name = {{{name|{{PAGENAME}}}}}
{{Infobox Ferret/mugshot|ferret-name = {{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}}}
| gender = {{{gender|}}}
| Arrival date = {{{arrivaldate|}}}
| Birthday = {{{birthday|}}}
| Valhalla date = {{{valhalla|}}}
| Playgroup = {{{playgroup|}}}
| Age = {{{age|}}}
}}
<tr><td colspan="2" class="infobox-centered">
{{#ifexist: File:{{{name}}}_Mugshot.png | [[File:{{{name}}}_Mugshot.png|192px]] | [[File:Unknown_Mugshot.png|192px]]  {{#if:{{#var:noCategories}}||[[Category:Ferret lacking infobox images]]}} <br><br> Missing: [[File:{{{name}}}_Mugshot.png|192px]]}}
</td></tr>
{{Infobox section|General details}}
{{Infobox section|General details}}
{{Infobox row|Name|{{{name|{{PAGENAME}}}}}}}
{{Infobox row|Name|{{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}}}
{{Infobox row|Nickname(s)|{{{nickname|}}}}}
{{Infobox row|Nickname(s)|{{{nickname|}}}}}
{{Infobox row|Shaye-Name|{{{shayename|}}}}}
{{Infobox row|Shaye-Name|{{{shayename|}}}}}
Line 27: Line 17:
{{Infobox row|Valhalla link|{{{valhallalink|}}}}}
{{Infobox row|Valhalla link|{{{valhallalink|}}}}}
{{Infobox row|Arrival link|{{{arrivallink|}}}}}
{{Infobox row|Arrival link|{{{arrivallink|}}}}}
{{Infobox end}}{{#if:{{#var:noCategories}}||[[Category:Ferret]]}}<!--
{{Infobox end}}
{{#if:{{#var:noCategories}}||[[Category:Ferret]]}}<!--


-->{{#if:{{NAMESPACE}}||{{#if:{{{noCargo|}}}||
-->{{#if:{{NAMESPACE}}||{{#if:{{{noCargo|}}}||
{{#cargo_store:_table=Ferret
{{#cargo_store:_table=Ferret
| name = {{{name|{{PAGENAME}}}}}
| name = {{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}
| gender = {{{gender|}}}
| gender = {{{gender|}}}
| arrivaldate = {{{arrivaldate|}}}
| arrivaldate = {{{arrivaldate|}}}