Àdàkọ:Stack
This template can be used to stack images and other floating content such as infobox templates without causing problems with spacing and floating. Enter a string of images/templates as the first parameter to have them stack without generating floating errors or spacing errors. You can stack many objects from the top of a section and not force further subsections to space out.
Usage
[àtúnṣe àmìọ̀rọ̀]At its simplest:
{{stack|<objects>}}
Alternatively, using {{stack begin}}
and {{stack end}}
:
{{stack begin}}
<objects>
{{stack end}}
The <object>
may simply be a string of wikicode for many images/templates.
Optional parameters
[àtúnṣe àmìọ̀rọ̀]{{stack| <object(s)> | float=left or right | clear=true or false}}
or
{{stack begin | float=left or right | clear=true or false}}
where
- float= left or right (default is right)
- This option can be used to float the stack to the left or right of the page
- clear= true or false (default is false)
- This option can be used to force the stack to the far left or right (e.g., near an infobox).
- margin= true or false (default is false)
- This option can be used to add a 1em margin to the left (for float right) or right (for float left).
You can also explicitly list multiple arguments:
{{stack| float=left or right | clear=true or false
|1=<object(s)>
|2=<object(s)>, etc. up to 9 parameters in the current version
}}
- This multiple argument version does include extra vertical whitespace between each (set of)
<object(s)>
.
Examples
[àtúnṣe àmìọ̀rọ̀]=====''Lipsum''=====
[[File:Simple shapes example.png|thumb|right|Example 1a]]
[[File:Simple shapes example.png|thumb|right|Example 1b]]
... text ...
=====''Lorem''=====
[[File:Simple shapes example.png|thumb|left|Example 1c]]
... text ...
=====''Ipsum''=====
... text ...
=====''Lipsum''=====
{{stack |[[File:Simple shapes example.png|thumb|right|Example 2a]] [[File:Simple shapes example.png|thumb|right|Example 2b]]}}
... text ...
=====''Lorem''=====
[[File:Simple shapes example.png|thumb|left|Example 2c]]
... text ...
=====''Ipsum''=====
... text ...
Without {{stack}}
[àtúnṣe àmìọ̀rọ̀]Lipsum
[àtúnṣe àmìọ̀rọ̀]Lorem
[àtúnṣe àmìọ̀rọ̀]Ipsum
[àtúnṣe àmìọ̀rọ̀]
With {{stack}}
[àtúnṣe àmìọ̀rọ̀]Lipsum
[àtúnṣe àmìọ̀rọ̀]Lorem
[àtúnṣe àmìọ̀rọ̀]Ipsum
[àtúnṣe àmìọ̀rọ̀]With {{stack begin}} and {{stack end}}
[àtúnṣe àmìọ̀rọ̀]Lipsum with second table wider
[àtúnṣe àmìọ̀rọ̀]Sample table 1 |
---|
Example 1a |
Example 1b |
Sample wider table 2 |
---|
Example 2a |
Example 2b |
Lorem
[àtúnṣe àmìọ̀rọ̀]Sample table 3 |
---|
Example 3a |
Ipsum
[àtúnṣe àmìọ̀rọ̀]Lipsum with first table wider
[àtúnṣe àmìọ̀rọ̀]Sample wider table 1 |
---|
Example 1a |
Example 1b |
Sample table 2 |
---|
Example 2a |
Example 2b |
Lorem
[àtúnṣe àmìọ̀rọ̀]Sample table 3 |
---|
Example 3a |
Ipsum
[àtúnṣe àmìọ̀rọ̀]More examples
[àtúnṣe àmìọ̀rọ̀]{{Stack}} can also be used to float one or more images across a page.
{{stack|[[File:Simple shapes example.png|80px]]}} {{stack|[[File:Simple shapes example.png|120px]]}}
It might take some experience to learn how the box area floats, in combination with various images or wikitables on a page. {{Stack}}'s operation is very quick, as it uses an HTML <table> to achieve its effects.
Floating portal boxes
[àtúnṣe àmìọ̀rọ̀]{{Stack}} can be used to float a portal box beside an infobox (or other right-aligned item) when other methods might not work as anticipated.
Infobox
|
This is a wikitable serving as a typical left-aligned table. The overlap on left-aligned tables had been a frequent problem when other boxes nearby were set to "float:right". So this is a test of how well a floating portal-box would avoid overlapping onto a left-side table. |
The example here uses {{stack}}
to float two portal boxes (Animals, Cats) as follows:
{{stack |{{portal|Animals}}{{portal|Cats}} }}
The two portal-boxes are stacked and floated together by both being listed as {{stack}}
's (first) parameter. Because the infobox and image were also stacked together, {{stack}}
moved the two portal-boxes alongside the infobox despite their being specified after the image.
Normally, a portal-box would be stuck below the Mona Lisa image, causing this entire text section to format further below, and causing a large text-gap of empty whitespace to appear near the infobox. There is no limit to the number of portalboxes (or Commonscat boxes) which can be listed within a {{stack}}
call, such as in a stub or an article with many stacked images near the bottom. Using {{stack}}
is extremely efficient, due to being a short template which uses builtin tag <table> to float the boxes.
Stack template family
[àtúnṣe àmìọ̀rọ̀]- {{Stack}}
- {{Stack begin}}
- {{Stack end}}
Tracking category
[àtúnṣe àmìọ̀rọ̀]See also
[àtúnṣe àmìọ̀rọ̀]- {{Multiple image}}, providing both vertical and horizontal layouts for multiple images.
- {{Superimpose}}, which places one image over another.
- {{Superimpose2}}, which can place up to fifty image layers over one another.
The above documentation is transcluded from Àdàkọ:Stack/doc. (àtúnṣe | ìtàn) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |