Difference between revisions of "Template:InfoBox"

From Hackerspace ACKspace
Jump to: navigation, search
m
(added Expire field (needs testing))
 
(7 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
<pre>
 
<pre>
 
{{InfoBox
 
{{InfoBox
|Type={[normal]|alert}
+
|Type={[normal]|alert|featured}
 
|Image=
 
|Image=
 
|Title=
 
|Title=
 
|Text=
 
|Text=
|Float=
+
|Float={left|right|[none]|inherit}
|Clear=
+
|Clear={left|right|both|[none]|inherit}
 
|Width=
 
|Width=
 +
|Color=
 +
|Background=
 +
|Expire=
 
}}
 
}}
 
</pre>
 
</pre>
 
Edit the page to see the template text.
 
Edit the page to see the template text.
</noinclude><includeonly>
+
 
<div style="border: 2px
+
Where <code>Expire</code> is an optional epoch timestamp when the info box will be hidden
 +
 
 +
[[Category:Workaround templates|{{PAGENAME}}]]</noinclude><includeonly>{{#ifexpr: {{{Expire|9999999999}}} - {{#time: xNU }} > 0 |<div style="border:  
 
{{#switch:
 
{{#switch:
 
   {{lc:
 
   {{lc:
 
     {{{Type|¬}}}
 
     {{{Type|¬}}}
 
   }}
 
   }}
   |¬|normal  = dashed #ccc;
+
   |¬|normal  = 2px dashed #ccc;
   ||alert    = solid red;
+
   ||alert    = 2px solid red;
 +
  ||featured  = 3px dashed #99f;
 
}}
 
}}
margin: 0.5em; padding: 1em; text-align:center; background: ;width: {{{Width}}}; float: {{{Float|inherit}}}; clear: {{{Clear|inherit}}};">
+
margin: 0.5em; padding: 1em; text-align:center; background: {{{Background|inherit}}}; color: {{{Color|inherit}}}; width: 100%; max-width: {{{Width|auto}}}; float: {{{Float|inherit}}}; clear: {{{Clear|inherit}}};">
 
   <div style="font-weight: bold">{{{Title|}}}</div>
 
   <div style="font-weight: bold">{{{Title|}}}</div>
 
   <div style="">{{{Text|}}}</div>
 
   <div style="">{{{Text|}}}</div>
 
</div>
 
</div>
</includeonly>
+
}}</includeonly>

Latest revision as of 10:25, 15 November 2018

This is the "Infobox" template. It should be called in the following format:

{{InfoBox
|Type={[normal]|alert|featured}
|Image=
|Title=
|Text=
|Float={left|right|[none]|inherit}
|Clear={left|right|both|[none]|inherit}
|Width=
|Color=
|Background=
|Expire=
}}

Edit the page to see the template text.

Where Expire is an optional epoch timestamp when the info box will be hidden