Anonymous
×
Create a new article
Write your page title here:
We currently have 57 articles on Vultroverse Wiki. Type your article name above or click on one of the titles below and start writing!



Template:NewInfoBox: Difference between revisions

No edit summary
 
(21 intermediate revisions by the same user not shown)
Line 58: Line 58:


<onlyinclude><includeonly>
<onlyinclude><includeonly>
<div style="float:{{{Align|right}}};clear:{{{Align|right}}};margin:1em 0 1em 1em;{{#if: {{{Border Color 2|}}}|border-top:{{{Border Width|2px}}} solid {{{Border Color 1|#AAAAAA}}};border-left:{{{Border Width|2px}}} solid {{{Border Color 1|#AAAAAA}}};border-right:{{{Border Width|2px}}} solid {{{Border Color 2|#AAAAAA}}};border-bottom:{{{Border Width|2px}}} solid {{{Border Color 2|#AAAAAA}}};|border:{{{Border Width|2px}}} solid {{{Border Color 1|#AAAAAA}}}}};background:#FFFFFF;-moz-border-radius:15px;border-radius:15px;padding:10px 10px 10px 10px;">
<div style="float:{{{Align|right}}};clear:both;margin:10px;{{#if: {{{Border Color 2|}}}|border-top:{{{Border Width|2px}}} solid {{{Border Color 1|#AAAAAA}}};border-left:{{{Border Width|2px}}} solid {{{Border Color 1|#AAAAAA}}};border-right:{{{Border Width|2px}}} solid {{{Border Color 2|#AAAAAA}}};border-bottom:{{{Border Width|2px}}} solid {{{Border Color 2|#AAAAAA}}};|border:{{{Border Width|2px}}} solid {{{Border Color 1|#AAAAAA}}}}};background:#FFFFFF;padding:10px 10px 10px 10px;max-width:250px;box-shadow: 5px 5px 5px #ccc;">
{{#if: {{{Header Color|}}}|}}
{{#if: {{{Header Color|}}}|}}
<div class="NavFrame collapsed"><div class="NavHead">
<div class="NavFrame collapsed"><div class="NavHead">
{{NewInfoBox/Header|{{{Name|''Name Here''}}}|{{{Header Color|#CCCCCC}}}}}
{{NewInfoBox/Header|{{{Name|''Name Here''}}}|{{{Header Color|#CCCCCC}}}|{{{Header Text Color|}}}}}
{{NewInfoBox/Image|{{{Image|Wiki-background}}}|{{{Image Caption|''Image Caption here''}}}|{{{Image Size|200px}}}}}
{{NewInfoBox/Image|{{{Image|}}}|{{{Image Caption|''Image Caption here''}}}|{{{Image Size|200px}}}}}
</div>
</div>
<div class="NavContent" style="clear:both;">
<div class="NavContent" style="clear:both;">
{{ #vardefine: i | 0 }}
{{ #vardefine: i | 0 }}
{{#while:|{{ #ifexpr: {{ #var: i }} < 50 | true }}|<nowiki/>{{#if: {{{Header{{ #var: i }}|}}}|{{NewInfoBox/Header|{{{Header{{ #var: i }}|}}}|{{{Header Color|#CCCCCC}}}}}}}{{#if: {{{Content{{ #var: i }}|}}}|{{NewInfoBox/Field|{{{Title{{ #var: i }}|}}}|{{#replace:{{{Content{{ #var: i }}|}}}|;;|<br/>}}|{{{Border Color 1|#AAAAAA}}}}}}}{{ #vardefine: i | {{ #expr: {{ #var: i }} + 1 }} }}}}
{{#while:|{{ #ifexpr: {{ #var: i }} < 50 | true }}|<nowiki/>{{#if: {{{Header{{ #var: i }}|}}}|{{NewInfoBox/Header|{{{Header{{ #var: i }}|}}}|{{{Header Color|#CCCCCC}}}|{{{Header Text Color|}}}}}}}{{#if: {{{Content{{ #var: i }}|}}}|{{NewInfoBox/Field|{{{Title{{ #var: i }}|}}}|{{#replace:{{#replace:{{{Content{{ #var: i }}|}}}|;|<br/>}}|*|<li>}}|{{{Border Color 1|#AAAAAA}}}}}}}{{ #vardefine: i | {{ #expr: {{ #var: i }} + 1 }} }}}}
</div>
</div>
</div>
</div>
</div>
</div>
</includeonly></onlyinclude>
</includeonly></onlyinclude>
<noinclude>
[[Category:Templates]]
</noinclude>

Latest revision as of 17:15, 11 December 2020

This template uses some small advanced code to generate an infobox template very easily.

Example


The code for this example is shown below:

{{NewInfoBox
|Align = right
|Border Width = 2px
|Name = Example
|Image Caption = This is an example
|Header1 = This is Header1
|Title1 = This is Title1
|Content1 = This is Content1
|Header2 = This is Header2
|Title2 = This is Title2
|Content2 = This is Content2
|Title3 = This is Title3
|Content3 = This is Content3
|Title4 = This is Title4
|Content4 = This is Content4}} 
 

Usage

Using this template is as simple as defining the Headers, Titles, and Contents.

Variables

When using this template, the following variables are available:

  • Align - Align the box to to the page. Can be "left" or "right".
  • Border Width - Width of the border in px units (like 2px).
  • Border Color 1 - Primary color of the border. Can be an HTML color name (like "red", "green", or "blue"), Hex code (like "#3399CC"), or RGB color value (like "RGB(000,127,255)").
  • Border Color 2 - Secondary color of the border. Can be an HTML color name (like "red", "green", or "blue"), Hex code (like "#3399CC"), or RGB color value (like "RGB(000,127,255)").
  • Header Color - Color of the headers. Can be an HTML color name (like "red", "green", or "blue"), Hex code (like "#3399CC"), or RGB color value (like "RGB(000,127,255)").
  • Name - The name at the top of the box.
  • Image - File name on the wiki (like "picture.jpg"). NOT a URL!
  • Image Caption - Caption text displayed under the image.
  • Image Size - the WIDTH of the image in px units (like 200px).

Following those, up to 50 of each of the following can be used:

  • Field$ - Will create a row on the infobox with the specified title where $ is a number 1-50.
  • Content$ - Will add content to the right side of a row on the infobox where $ is a number 1-50.
  • Header$ - Will create a header above Title$ and Content$ where $ is the same number 1-50.