Difference between revisions of "Template:Main Page Box"

From Learn Na'vi Wiki
Jump to navigation Jump to search
(optical update)
(added category)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div style="-moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; margin-bottom: 1em; padding: 2px; border:1px solid #4080FF; background-color: #F2F7FF;
+
<includeonly><div class="mpb{{#switch: {{{position}}}
{{#switch: {{{position}}}
+
  | full =
  | center =  
+
  | left =-left
  | left = margin-right: 0.5em;
+
  | right =-right
  | right = margin-left: 0.5em;
 
 
  | default  
 
  | default  
 
}}">
 
}}">
<h{{{h}}} style="-moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; background-color: #d9e5ff; border: 1px solid #BFD3FF; margin: 0 !important;{{#ifeq:{{{h}}}|1|text-align: center;padding: 6px;|padding: 4px;}}">{{{hline}}}</h{{{h}}}>
+
<h{{{h}}} class="mpb-h{{{h}}}">{{{hline}}}</h{{{h}}}>
<div style="padding: 4px;">
+
<div>
 
{{{content}}}
 
{{{content}}}
 
</div>
 
</div>
Line 16: Line 15:
 
== There are exactly four parameters: ==
 
== There are exactly four parameters: ==
  
{| style="background-color:#89D1FC;-moz-border-radius:4px 4px 4px 4px;"
+
{| style="background-color:#89D1FC;"
 
|- style="background-color:#e3f3fc;"
 
|- style="background-color:#e3f3fc;"
 
! Parameter !! possible Values !! Results  
 
! Parameter !! possible Values !! Results  
Line 23: Line 22:
 
* the '''left''' causes the box to have a '''0.3em''' margin to the right
 
* the '''left''' causes the box to have a '''0.3em''' margin to the right
 
* the '''right''' generates a '''0.3em''' margin to the left
 
* the '''right''' generates a '''0.3em''' margin to the left
* the '''center''' option has '''no margin''' to a side
+
* the '''full''' option has '''no margin''' to a side
 
|- style="background-color:#e3f3fc;"
 
|- style="background-color:#e3f3fc;"
 
| <pre>h =</pre> || <pre>1, 3</pre> ||
 
| <pre>h =</pre> || <pre>1, 3</pre> ||
Line 37: Line 36:
  
 
== This is how it works: ==
 
== This is how it works: ==
{| style="background-color:#89D1FC;-moz-border-radius:4px 4px 4px 4px;"
+
{| style="background-color:#89D1FC;"
 
|- style="background-color:#e3f3fc;"
 
|- style="background-color:#e3f3fc;"
 
! sample code !! Result
 
! sample code !! Result
Line 60: Line 59:
 
|- style="background-color:#e3f3fc;"
 
|- style="background-color:#e3f3fc;"
 
| <pre><nowiki>{{Main Page Box
 
| <pre><nowiki>{{Main Page Box
| position = center
+
| position = full
 
| h = 1
 
| h = 1
 
| hline = Big Title:
 
| hline = Big Title:
Line 69: Line 68:
 
}}</nowiki></pre> ||
 
}}</nowiki></pre> ||
 
{{Main Page Box
 
{{Main Page Box
| position = center
+
| position = full
 
| h = 1
 
| h = 1
 
| hline = Big Title:
 
| hline = Big Title:
Line 79: Line 78:
  
 
|- style="background-color:#e3f3fc;"
 
|- style="background-color:#e3f3fc;"
| <pre><nowiki>{{Main Page Box
+
| <pre>{{Main Page Box
 
| position = right
 
| position = right
 
| h = 3
 
| h = 3
Line 86: Line 85:
 
some lines<br />of text
 
some lines<br />of text
 
* "left" box results in right margin
 
* "left" box results in right margin
}}</nowiki></pre> ||
+
}}</pre> ||
 
{{Main Page Box
 
{{Main Page Box
 
| position = right
 
| position = right
Line 97: Line 96:
 
|}
 
|}
 
__NOTOC__ __NOEDITSECTION__
 
__NOTOC__ __NOEDITSECTION__
 +
[[Category:Template]]
 
</noinclude>
 
</noinclude>

Latest revision as of 23:51, 25 January 2011

This is a shiny Template for creating the Main Page Boxes.

There are exactly four parameters:

Parameter possible Values Results
position =
left, right, full
  • the left causes the box to have a 0.3em margin to the right
  • the right generates a 0.3em margin to the left
  • the full option has no margin to a side
h =
1, 3
  • 1 is just for the big headline h1 size and centered
  • 3 is for the smaller ones
hline =
one line of text
  • this goes to the content of the head line
content =
some more text
  • this goes to the main content of the box

This is how it works:

sample code Result
{{Main Page Box
| position = left
| h = 3
| hline = Title:
| content =
some lines<br />of text
}}

Title:

some lines
of text

  • "left" box results in right margin


{{Main Page Box
| position = full
| h = 1
| hline = Big Title:
| content =
compare:
* the margin to the table border
* the position and size of the title
}}

Big Title:

compare:

  • the margin to the table border
  • the position and size of the title


{{Main Page Box
| position = right
| h = 3
| hline = Title:
| content =
some lines<br />of text
* "left" box results in right margin
}}

Title:

some lines
of text

  • "left" box results in right margin