Difference between revisions of "Template:Navbox"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Template creation)
 
m (Fix some presentation)
Line 8: Line 8:
 
{{{title5|}}}{{{content5|}}}
 
{{{title5|}}}{{{content5|}}}
 
|
 
|
{{{!}} {{#if:{{{sub|}}}||class{{=}}"mw-collapsible"}} style{{=}}"{{#if:{{{sub|}}}|margin: -0.125em -0.5em;|font-size: .85em;}} width: 100%"
+
{{{!}} {{#if:{{{sub|}}}||class{{=}}"mw-collapsible"}} style{{=}}"{{#if:{{{sub|}}}
{{#if:{{{title|}}}|
+
| margin: -0.125em -0.5em; width: 100%;
{{!}}- style{{=}}"background-color: {{{color|inherit}}}; padding: .5em"
+
| font-size: .85em; margin: 1em auto;
! colspan{{=}}"2" {{!}} {{{title}}}
+
}} min-width: 75%"
 +
{{#if:{{{sub|}}}||
 +
{{!}}- style{{=}}"background-color: {{{color|#DDD}}}"
 +
! colspan{{=}}"2" {{!}} {{#if:{{{title|}}}|<span style="font-size: 1.25em; padding: .5em 2em">{{{title}}}</span>}}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
Line 18: Line 21:
 
|
 
|
 
{{#if:{{{title1|}}}
 
{{#if:{{{title1|}}}
| ! style{{=}}"background-color: {{{color1|#DDD}}}" {{!}} {{{title1}}}
+
| ! style{{=}}"background-color: {{{color1|#EEE}}}; padding: .5em 1em" {{!}} {{{title1}}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{{content1|}}}
 
{{{content1|}}}
| {{!}} colspan{{=}}"2" style="padding: 0.5em; text-align: center" {{!}} {{{content1|}}} }}
+
| {{!}} colspan{{=}}"2" style{{=}}"padding: 0.5em; text-align: center" {{!}} {{{content1|}}} }}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
Line 28: Line 31:
 
|
 
|
 
{{#if:{{{title2|}}}
 
{{#if:{{{title2|}}}
| ! style{{=}}"background-color: {{{color2|#DDD}}}" {{!}} {{{title2}}}
+
| ! style{{=}}"background-color: {{{color2|#EEE}}}; padding: 0.5em 1em" {{!}} {{{title2}}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{{content2|}}}
 
{{{content2|}}}
| {{!}} colspan{{=}}"2" style="padding: 0.5em; text-align: center" {{!}} {{{content2|}}} }}
+
| {{!}} colspan{{=}}"2" style{{=}}"padding: 0.5em; text-align: center" {{!}} {{{content2|}}} }}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
Line 38: Line 41:
 
|
 
|
 
{{#if:{{{title3|}}}
 
{{#if:{{{title3|}}}
| ! style{{=}}"background-color: {{{color3|#DDD}}}" {{!}} {{{title3}}}
+
| ! style{{=}}"background-color: {{{color3|#EEE}}}; padding: 0.5em 1em" {{!}} {{{title3}}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{{content3|}}}
 
{{{content3|}}}
| {{!}} colspan{{=}}"2" style="padding: 0.5em; text-align: center" {{!}} {{{content3|}}} }}
+
| {{!}} colspan{{=}}"2" style{{=}}"padding: 0.5em; text-align: center" {{!}} {{{content3|}}} }}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
Line 48: Line 51:
 
|
 
|
 
{{#if:{{{title4|}}}
 
{{#if:{{{title4|}}}
| ! style{{=}}"background-color: {{{color4|#DDD}}}" {{!}} {{{title4}}}
+
| ! style{{=}}"background-color: {{{color4|#EEE}}}; padding: 0.5em 1em" {{!}} {{{title4}}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{{content4|}}}
 
{{{content4|}}}
| {{!}} colspan{{=}}"2" style="padding: 0.5em; text-align: center" {{!}} {{{content4|}}} }}
+
| {{!}} colspan{{=}}"2" style{{=}}"padding: 0.5em; text-align: center" {{!}} {{{content4|}}} }}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
Line 58: Line 61:
 
|
 
|
 
{{#if:{{{title5|}}}
 
{{#if:{{{title5|}}}
| ! style{{=}}"background-color: {{{color5|#DDD}}}" {{!}} {{{title5}}}
+
| ! style{{=}}"background-color: {{{color5|#EEE}}}; padding: 0.5em 1em" {{!}} {{{title5}}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{!}} style{{=}}"padding: 0 0.5em" {{!}}
 
{{{content5|}}}
 
{{{content5|}}}
| {{!}} colspan{{=}}"2" style="padding: 0.5em; text-align: center" {{!}} {{{content5|}}} }}
+
| {{!}} colspan{{=}}"2" style{{=}}"padding: 0.5em; text-align: center" {{!}} {{{content5|}}} }}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
Line 76: Line 79:
 
* color'''#''': (Optional, default <tt>#DDDDDD</tt>) # in range 1..5: row 1..5 title colour
 
* color'''#''': (Optional, default <tt>#DDDDDD</tt>) # in range 1..5: row 1..5 title colour
 
* content'''#''': (Optional, default empty) # in range 1..5: row 1..5 cell content
 
* content'''#''': (Optional, default empty) # in range 1..5: row 1..5 cell content
* sub: (Optional, default empty) '''y''' defines if border and collapsible are shown
+
* sub: (Optional, default empty) <tt>y</tt> defines if border and collapsible are shown
  
 
{| style="border: 1px solid #AAA; border-collapse: collapse; border-radius: .25em; width: 100%"
 
{| style="border: 1px solid #AAA; border-collapse: collapse; border-radius: .25em; width: 100%"
Line 82: Line 85:
 
|- style="background-color: #DDD"
 
|- style="background-color: #DDD"
 
! Code
 
! Code
! Result
+
! style="min-width: 50%" | Result
 
|-
 
|-
 
| <nowiki>{{NavboxWiki}}</nowiki>
 
| <nowiki>{{NavboxWiki}}</nowiki>
Line 89: Line 92:
 
| <nowiki>{{NavboxWiki|Hello there!}}</nowiki>
 
| <nowiki>{{NavboxWiki|Hello there!}}</nowiki>
 
| {{NavboxWiki|Hello there!}}
 
| {{NavboxWiki|Hello there!}}
 +
|- style="vertical-align: top"
 +
| <pre>{{NavboxWiki
 +
|title1= Title 1
 +
|content1= Hello, first content!
 +
}}</pre>
 +
| {{NavboxWiki
 +
|title1= Title 1
 +
|content1= Hello, first content!
 +
|title2= Title 2
 +
|content2= Hello, second content!
 +
}}
 +
|- style="vertical-align: top"
 +
| <pre>{{NavboxWiki
 +
|title= title displays collapse option
 +
|title1= category
 +
|content1= content that is displayed here
 +
}}</pre>
 +
| {{NavboxWiki
 +
|title= title displays collapse option
 +
|title1= category
 +
|content1= content that is displayed here
 +
}}
 
|- style="vertical-align: top"
 
|- style="vertical-align: top"
 
| <pre>{{NavboxWiki
 
| <pre>{{NavboxWiki

Revision as of 09:15, 28 December 2020

Usage

{{NavboxWiki|title|color|title#|color#|content#|sub}}

  • title: (Optional) navbox title
  • color: (Optional, default #)
  • title#: (Optional, default empty) # in range 1..5: row 1..5 title
  • color#: (Optional, default #DDDDDD) # in range 1..5: row 1..5 title colour
  • content#: (Optional, default empty) # in range 1..5: row 1..5 cell content
  • sub: (Optional, default empty) y defines if border and collapsible are shown
Examples
Code Result
{{NavboxWiki}} NavboxWiki
{{NavboxWiki|Hello there!}} NavboxWiki
{{NavboxWiki
	|title1= Title 1
	|content1= Hello, first content!
}}
NavboxWiki
{{NavboxWiki
	|title= title displays collapse option
	|title1= category
	|content1= content that is displayed here
}}
NavboxWiki
{{NavboxWiki
	|title= NAVBOX TITLE
	|color= #DAD
	|title1= Title 1
	|color1= #AAF
	|content1= Hello, first content!
	|content2= Wait… no title?
	|title3= hahaha
	|content3= Yep, no title.
}}
NavboxWiki
{{NavboxWiki
	|title= NAVBOX TITLE
	|color= #CDF
	|title1= Title 1
	|content1=
		{{NavboxWiki
			|sub= y
			|title1= title1
			|content1= content1
			|title2= title2
			|color2= #FAA
			|content2= content2
			|title3= title3
			|content3=
				{{NavboxWiki
					|sub= y
					|title1= wait…
					|content1= stop!
					|title2= enough!
					|content2= I said.
				}}
		}}
	}}
NavboxWiki