Difference between revisions of "Template:Teaser"

From Culture.si
 
(59 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{dataRow|Teaser100|{{#sub|{{{1|}}}|0|100}} }}
+
<noinclude><pre><nowiki>
<div id="teaser">
+
{{Teaser
 +
| image = FileName.jpg
 +
| caption = Caption for the teaser image, will be read from the image page if missing
 +
|
 +
Text of the teaser .... Use 1= if the text contains equal signs.
 +
}}
 +
</nowiki></pre></noinclude><includeonly><div id="teaser">
 +
{{#if:{{{image|}}}
 +
| {{#ifeq:{{{caption}}}|{{{caption|}}}|{{Image|{{{image}}}|caption={{{caption}}}}}|{{Image|{{{image}}}}}
 +
}}{{#set:TeaserImgDesc={{{caption|{{#show:image:{{{image}}}|?Description}}}}}}}
 +
}}
 
{{{1}}}
 
{{{1}}}
 
</div>
 
</div>
{{#prop:set|Teaser|{{#replace:{{#replace:{{#replace:{{{1|}}}|320px|282px}} |250px|221px}}  |568px|282px}} }}
+
{{{=
 +
| real_image = {{#if:{{{image|}}}|File:{{{image}}}|{{#arr:getitem|{{#arr:getitem|{{#arr:match|{{{1}}}|(File:{{!}}Image:{{!}}image\{{!}}).*\.(jpg{{!}}JPG)}}|0|}}|0|}}}}
 +
| intro = {{first_sentence|{{{1}}}}}
 +
}}}{{#if:{{#str:trim|{{{1|}}}}}
 +
|{{dataRow|Teaser100|{{{intro}}}
 +
}}{{ImageDataRow|TeaserImg|{{{real_image}}}
 +
}}{{dataRow|TeaserText|{{#eval:text|{{{intro}}}}}
 +
}}{{#data:set|Teaser|page={{FULLPAGENAME}}|intro={{{intro}}}|image={{{real_image}}}
 +
}}{{setProp|Teaser100|{{#eval:parse|{{{intro}}}}}
 +
}}{{setProp|teaser|{{#replace:{{#replace:{{#replace:{{{1|}}}|320px|576px}} |250px|576px}}  |568px|576px}}
 +
}}{{#prop:set|Teaser|{{#replace:{{#replace:{{#replace:{{{1|}}}|320px|576px}} |250px|576px}}  |568px|576px}}}}}}</includeonly>

Latest revision as of 18:36, 13 April 2021

{{Teaser
| image = FileName.jpg
| caption = Caption for the teaser image, will be read from the image page if missing
| 
Text of the teaser .... Use 1= if the text contains equal signs.
}}