Difference between revisions of "Template:Layouts/ImagesLeftContentRight"
DesignerThan (talk | contribs) |
DesignerThan (talk | contribs) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly><templatestyles src="Layouts/ImagesLeftContentRight/style.css" /><div id="imgLeft-contentRight-container" class="mw-parser-output"> | + | <includeonly><onlyinclude><templatestyles src="Layouts/ImagesLeftContentRight/style.css" /><div id="imgLeft-contentRight-container" class="mw-parser-output"> |
<div class="images-container"> | <div class="images-container"> | ||
{{#forargs: image_ | {{#forargs: image_ | ||
| keyOfImg | | keyOfImg | ||
| theImage | | theImage | ||
− | | <nowiki />{{#if:{{#var:theImage|}}|[[image:{{#var:theImage}}|{{{ | + | | <nowiki />{{#if:{{#var:theImage|}}|[[image:{{#var:theImage}}|{{{imageWidth_{{#var:keyOfImg}}|300px}}}|{{{imageCaption_{{#var:keyOfImg}}|}}}]]<p class="image-caption"><small>{{{imageCaption_{{#var:keyOfImg}}|}}}</small></p>}} |
}} | }} | ||
</div> | </div> | ||
<div class="content-container"> | <div class="content-container"> | ||
− | {{#if: content_heading|<h3>{{{content_heading}}}</h3>}} | + | {{#if: {{{content_heading|}}}|<h3>{{{content_heading}}}</h3>}} |
{{{content}}} | {{{content}}} | ||
</div> | </div> | ||
− | </div></includeonly> | + | </div></onlyinclude></includeonly> |
<noinclude> | <noinclude> | ||
− | [[Category: | + | [[Category:Layout Components]][[Category:UsesLoops]] |
Usage: | Usage: | ||
− | + | :<nowiki>{{Layouts/ImagesLeftContentRight</nowiki> | |
− | + | ::<nowiki>|image_1 = </nowiki> | |
+ | ::<nowiki>|imageWidth_1 = </nowiki> | ||
+ | ::<nowiki>|imageCaption_1 = </nowiki> | ||
+ | ::<nowiki>|image_n = </nowiki> | ||
+ | ::<nowiki>|imageWidth_n = </nowiki> | ||
+ | ::<nowiki>|imageCaption_n = </nowiki> | ||
+ | ::<nowiki>|content_heading = </nowiki> | ||
+ | ::<nowiki>|content = </nowiki> | ||
+ | :<nowiki>}}</nowiki> | ||
Example: | Example: | ||
{{Layouts/ImagesLeftContentRight | {{Layouts/ImagesLeftContentRight | ||
| image_1 = Amaranthus tricolor0.jpg | | image_1 = Amaranthus tricolor0.jpg | ||
+ | | imageCaption_1 = Test caption | ||
| content_heading = Amaranth | | content_heading = Amaranth | ||
| content = Amaranth, is a cosmopolitan genus of annual or short-lived perennial plants. Catkin-like cymes of densely packed flowers grow in summer or autumn. Approximately 60 species are recognized, with inflorescences and foliage ranging from purple and red to green or gold. | | content = Amaranth, is a cosmopolitan genus of annual or short-lived perennial plants. Catkin-like cymes of densely packed flowers grow in summer or autumn. Approximately 60 species are recognized, with inflorescences and foliage ranging from purple and red to green or gold. | ||
Line 27: | Line 36: | ||
{{Layouts/ImagesLeftContentRight | {{Layouts/ImagesLeftContentRight | ||
| image_1 = Oenothera biennis 20050825 962.jpg | | image_1 = Oenothera biennis 20050825 962.jpg | ||
− | | | + | | imageCaption_1 = Tap root shown next to a carrot for comparison. |
| image_2 = Oenothera-biennis-root.jpg | | image_2 = Oenothera-biennis-root.jpg | ||
| content_heading = Evening Primrose | | content_heading = Evening Primrose | ||
Line 34: | Line 43: | ||
</noinclude> | </noinclude> | ||
{{clear}} | {{clear}} | ||
+ | <templatedata> | ||
+ | { | ||
+ | "params": { | ||
+ | "content_heading": { | ||
+ | "label": "Heading of the Text", | ||
+ | "description": "Heading of the Text on the right of the images", | ||
+ | "type": "string" | ||
+ | }, | ||
+ | "content": { | ||
+ | "label": "Text", | ||
+ | "description": "The text which shall go on the right of the images. It should be possible to pass in every wikitext.", | ||
+ | "type": "unbalanced-wikitext" | ||
+ | }, | ||
+ | "image_n": { | ||
+ | "label": "Image n", | ||
+ | "description": "Replace the n with a number starting at 1. That way it is possible to add multiple images into the template.", | ||
+ | "type": "wiki-file-name" | ||
+ | }, | ||
+ | "imageWidth_n": { | ||
+ | "label": "Width of Image n", | ||
+ | "description": "Replace n with the number of the image you want to define the width. Normally that shouldn't be needed." | ||
+ | }, | ||
+ | "imageCaption_n": { | ||
+ | "label": "Caption of Image n", | ||
+ | "description": "Replace n with the number of the image you want to define the caption. The caption is a short description of what the image shows.", | ||
+ | "type": "string" | ||
+ | } | ||
+ | }, | ||
+ | "description": "This Template creates a Layout where the images are on the left side of the page and the text on the right. It is mobile friendly, that means that as the screen gets smaller the images will then go on top of the text and the text will follow.", | ||
+ | "paramOrder": [ | ||
+ | "content_heading", | ||
+ | "content", | ||
+ | "image_n", | ||
+ | "imageWidth_n", | ||
+ | "imageCaption_n" | ||
+ | ] | ||
+ | } | ||
+ | </templatedata> |
Latest revision as of 15:58, 3 April 2022
Usage:
- {{Layouts/ImagesLeftContentRight
- |image_1 =
- |imageWidth_1 =
- |imageCaption_1 =
- |image_n =
- |imageWidth_n =
- |imageCaption_n =
- |content_heading =
- |content =
- }}
Example:
Amaranth
Amaranth, is a cosmopolitan genus of annual or short-lived perennial plants. Catkin-like cymes of densely packed flowers grow in summer or autumn. Approximately 60 species are recognized, with inflorescences and foliage ranging from purple and red to green or gold. Although several species are often considered weeds, people around the world value amaranths as leaf vegetables and cereals.
Evening Primrose
Evening primrose (Oenothera biennis) is a biennial (living for two years) flowering plant growing to 30–150 cm tall. The leaves are lanceolate, 5–20 cm long and 1–2.5 cm broad, produced in a tight rosette in the first year, and spirally on the stem in the second year. The flowers are pale yellow, 2.5–5 cm diameter, with four petals; they are produced on a tall spike from late spring to late summer. They open in the evening, hence the name "evening primrose", and close by the following noon.
This Template creates a Layout where the images are on the left side of the page and the text on the right. It is mobile friendly, that means that as the screen gets smaller the images will then go on top of the text and the text will follow.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Heading of the Text | content_heading | Heading of the Text on the right of the images | String | optional |
Text | content | The text which shall go on the right of the images. It should be possible to pass in every wikitext. | Unbalanced wikitext | optional |
Image n | image_n | Replace the n with a number starting at 1. That way it is possible to add multiple images into the template. | File | optional |
Width of Image n | imageWidth_n | Replace n with the number of the image you want to define the width. Normally that shouldn't be needed. | Unknown | optional |
Caption of Image n | imageCaption_n | Replace n with the number of the image you want to define the caption. The caption is a short description of what the image shows. | String | optional |