Difference between revisions of "Template:Stacked image"

From RimWorld Wiki
Jump to navigation Jump to search
Line 1: Line 1:
<includeonly><div style="float: left; position: relative; width: {{{3|{{{width|300px}}}}}}px;">[[File:{{PAGENAME:{{{1|{{{bottom image<noinclude>|Example.png</noinclude>}}}}}}}}|right|{{{3|{{{width|300px}}}}}}px|{{{4|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}}]]
+
<includeonly><div style="float: left; position: relative; width: {{{3|{{{width|300}}}}}}px;">[[File:{{PAGENAME:{{{1|{{{bottom image}}}}}}}}|right|{{{3|{{{width|300}}}}}}px|{{{4| {{{caption}}} }}}]]
<div style="float: right; position: absolute; width: {{{3|{{{width|300px}}}}}}px;">[[File:{{PAGENAME:{{{2|{{{top image<noinclude>|Example.svg</noinclude>}}}}}}}}|right|{{{3|{{{width|300px}}}}}}px|{{{4|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}}|link=File:{{PAGENAME:{{{1|{{{bottom image<noinclude>|File:Bad Title Example.png</noinclude>}}}}}}}}]]</div>
+
<div style="float: right; position: absolute; width: {{{3|{{{width|300}}}}}}px;">[[File:{{PAGENAME:{{{2|{{{top image}}}}}}}}|right|{{{3|{{{width|300}}}}}}px|{{{4|{{{caption}}} }}}|link={{{5| {{{link|File:{{PAGENAME:{{{1|{{{bottom image}}}}}}}}}}} }}}]]</div>
  
<div style="float: left; position: absolute; top: {{{5|{{{top|5px}}}}}}px; left: {{{6|{{{left|5px}}}}}}px;"><span style="font-size:85%;">'''[[:File:{{PAGENAME:{{{1|{{{bottom image<noinclude>|File:Bad Title Example.png</noinclude>}}}}}}}}|<span style="color:{{{7|{{{link color|}}}}}};">image</span>]]''' · '''[[:File:{{PAGENAME:{{{2|{{{top image<noinclude>|Example.svg</noinclude>}}}}}}}}|<span style="color:{{{7|{{{link color|}}}}}};">labels</span>]]'''</span></div>
 
 
</div>
 
</div>
 
</includeonly>
 
</includeonly>
 
<noinclude>
 
<noinclude>
{{Stacked image|GeneBackground ArchiteGene.png|Gene Ageless.png|128|Example text|5|5|#fff}}
+
{{Stacked image|bottom image=GeneBackground Endogene.png|top image=Gene DeadCalm.png|width=48|caption=Example text|link=Genes#Dead calm}}
<div style="float: right;">{{Stacked image|GeneBackground Xenogene.png|Gene Depressive.png|128|Example text|5|5|#fff}}</div>
+
 
 +
{{Stacked image|GeneBackground ArchiteGene.png|Gene Ageless.png|128|Example text}}
 +
<div style="float: right;">{{Stacked image|GeneBackground Xenogene.png|Gene Depressive.png|128|Example text|Genes#Very unhappy}}</div>
  
 
{{Documentation}}</noinclude>
 
{{Documentation}}</noinclude>

Revision as of 12:46, 7 March 2023


Example text
Example text


Example text
Example text


Example text
Example text
Documentation icon Template documentation[view] [edit] [history] [purge]

As the name implies, this template allows for the stacking of images. It is based on Wikipedia's Template:Stacked image

Note that at this time, the sizes of the image have to be the same.

Parameters

The template takes the following parameters either unnamed in this order, or named in any order. Best practice is to maintain this order regardless.

  • bottom image: Mandatory
  • top image: Mandatory
  • width: Optional. Defined in px. Defaults to 300
  • caption: Caption to display on mouse hover. Optional. Defaults to link.
  • link: Optional. Defaults to link to bottom image used.
  • float: Optional. Defaults to none. Typically only none, left, and right will be necessary.
  • padding: Add padding to the left of the stacked image, measured in pixels. Positive moves it right, negative moves it right. Optional. Defaults to 0.

Examples

Named

{{Stacked image|bottom image=GeneBackground Endogene.png|top image=Gene DeadCalm.png|width=48|caption=Example text|link=Genes#Dead calm}}

Produces:

Example text
Example text


Unnamed

{{Stacked image|GeneBackground ArchiteGene.png|Gene Ageless.png|128|Example text|Genes#Ageless}}

Produces:

Example text
Example text


Float right

{{Stacked image|GeneBackground Xenogene.png|Gene Depressive.png|64|Example text|Genes#Very unhappy|right}}

Produces:

Example text
Example text


Padding

Example text
Example text


Example text
Example text


Unpadded Padded