Template:MenuBox/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Template doc)
 
(Updating the doc)
 
Line 2: Line 2:


Creates a right-floating navigation box. This template will normally be wrapped in another.
Creates a right-floating navigation box. This template will normally be wrapped in another.
{{tip|If you don't want the title to become a link, you can trick it by using <code>link&#61;name of current page</code>.}}
 
== Simple example ==
== Parameters ==
{| class="standard-table plainlinks" style="width:100%"
! style="width:12%" | Parameter
! Description
! Example
|-
| align="center" | {{Code|style=2|{{Param|title}}}}
| Title of the menu box.
| {{CodeBlock|margin=5px|<nowiki>| title = Main Page</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|link}}}}
| Adds a link for the title. If this is not set, it will use the {{param|title}} as the link.
| {{CodeBlock|margin=5px|<nowiki>| link = Half-Life 2</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|nolink}}}}
| Prevents the link from being loaded. Useful for pages that don't have a page for it.
| {{CodeBlock|margin=5px|<nowiki>| nolink = 1</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|icon}}}}
| A file link that will be placed before the title.
| {{CodeBlock|margin=5px|<nowiki>| icon = [[File:Icon hl2.png|link=Half-Life 2]] (or {{hl2}})</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|text}}}}
| Used for adding a list of items or text.
| {{CodeBlock|margin=5px|<nowiki>| text = <span>
# MenuBox List Item 1
# MenuBox List Item 2
# MenuBox List Item 3
# MenuBox List Item 4
# MenuBox List Item 5
# MenuBox List Item 6
# MenuBox List Item 7
</span></nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|txtcolor}}}}
| Color of the content text.
| {{CodeBlock|margin=5px|<nowiki>| txtcolor = </nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|bgcolor}}}}
| Main background color.
| {{CodeBlock|margin=5px|<nowiki>| bgcolor = #323232</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|bgcolor2}}}}
| Title box colormain background color.
| {{CodeBlock|margin=5px|<nowiki>| bgcolor2 = #262626</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|bdcolor}}}}
| Outer border color.
| {{CodeBlock|margin=5px|<nowiki>| bdcolor = #525252</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|bdcolor2}}}}
| Bottom border on title box.
| {{CodeBlock|margin=5px|<nowiki>| bdcolor2 = #262626</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|nofloat}}}}
| Sets the position to be inline.
| {{CodeBlock|margin=5px|<nowiki>| nofloat = 1</nowiki>}}
|}
 
== Preview and example ==


{{MenuBox
{{MenuBox
|title= Main Page
| title = Main Page
|icon= {{hl2}}
| icon = {{hl2}}
|text= <span>
| text = <span>
# MenuBox List Item 1
# MenuBox List Item 1
# MenuBox List Item 2
# MenuBox List Item 2
Line 18: Line 77:
</span>
</span>
}}
}}
<pre>
<pre>{{MenuBox
{{MenuBox
| title = Main Page
|title= Main Page
| icon = {{hl2}}
|icon= [[File:Icon hl2.png|link=Half-Life 2]] (or {{hl2}})
| text = <span>
|text= <span>
# MenuBox List Item 1
# MenuBox List Item 1
# MenuBox List Item 2
# MenuBox List Item 2
Line 32: Line 90:
</span>
</span>
}}</pre>
}}</pre>
== All parameters ==
<pre>{{MenuBox
|title = page to link at top
|link = alternative link for the title
|icon = a file link that will be placed before the title
|text = content text
|txtcolor = color of the content text
|bgcolor = main background color
|bgcolor2 = title box color
|bdcolor = outer border color
|bdcolor2 = bottom border on title box
|nofloat = set true to appear inline
}}
</pre>

Latest revision as of 11:53, 26 February 2025

Edit-copy.png
This is a documentation subpage for Template:MenuBox.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

Creates a right-floating navigation box. This template will normally be wrapped in another.

Parameters

Preview and example

{{MenuBox
| title = Main Page
| icon = {{hl2}}
| text = <span>
# MenuBox List Item 1
# MenuBox List Item 2
# MenuBox List Item 3
# MenuBox List Item 4
# MenuBox List Item 5
# MenuBox List Item 6
# MenuBox List Item 7
</span>
}}