Template:Navbox/Icon: Difference between revisions

From The Political Machine - Official Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Tag: Undo
 
Line 1: Line 1:
<includeonly>{{#if: {{{link|}}} | {{#vardefine:pagelink| {{{link}}} }} | {{#vardefine:pagelink| {{#var:gamelink}}/{{{subpage|{{{text|}}} }}} }} }}
<includeonly>{{#if: {{{link|}}} | {{#vardefine:pagelink| {{{link}}} }} | {{#vardefine:pagelink| {{#var:gamelink}}/{{{subpage|{{{text}}}}}} }} }}<span style="text-align:center; float:left; overflow:hidden; margin-left:1px; margin-right:1px;"><div>[[File:{{{image}}} | {{{width|{{#var:iconwidth}}}}}x{{{height|{{#var:iconheight}}}}}px | {{{text|}}} | link={{#var:pagelink}} ]]</div>{{#if: {{{text|}}} | <div style="line-height:1; text-align:center; font-size:{{{textsize|{{#var:textsize}}}}}em; width:{{{textwidth|{{#var:textwidth}}}}}px; height:{{#var:maxlines}}em; margin:auto">[[{{#var:pagelink}} | {{{text}}}]]</div>}}</span></includeonly><noinclude>
<span style="text-align:center; float:left; overflow:hidden; margin-left:1px; margin-right:1px;">
<div>
  {{#if: {{#isurl:{{#var:pagelink}}}} | <!-- Check if 'pagelink' is a URL -->
    <a href="{{#var:pagelink}}" class="image"> <!-- External link -->
      <img src="{{filepath:{{{image}}}}}" width="{{{width|{{#var:iconwidth}}}}}" height="{{{height|{{#var:iconheight}}}}}" alt="{{{text|}}}" />
    </a>
  | <!-- Else, treat as internal link -->
    [[File:{{{image}}} | {{{width|{{#var:iconwidth}}}}}x{{{height|{{#var:iconheight}}}}}px | link={{#var:pagelink}} ]]
  }}
</div>
{{#if: {{{text|}}} |
  <div style="line-height:1; text-align:center; font-size:{{{textsize|{{#var:textsize}}}}}em; width:{{{textwidth|{{#var:textwidth}}}}}px; height:{{#var:maxlines}}em; margin:auto">
    {{#if: {{#isurl:{{#var:pagelink}}}} | <!-- Check if 'pagelink' is a URL -->
      <a href="{{#var:pagelink}}">{{{text}}}</a> <!-- External link text -->
    |
      [[{{#var:pagelink}}|{{{text}}}]] <!-- Internal link text -->
    }}
  </div>
}}
</span></includeonly>
 
See {{Tlx|Navbox}} for documentation.
See {{Tlx|Navbox}} for documentation.
[[Category:Universal]]
[[Category:Universal]]
[[Category:Templates]]</noinclude>
[[Category:Templates]]</noinclude>

Latest revision as of 21:59, 8 March 2024

See {{Navbox}} for documentation.