Template:MenuBox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(removed need for <span>, made width automatic)
No edit summary
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly><div style="position:relative;margin:0 0 1em 1em;{{#if: {{{nofloat|}}} | display:inline-block; | float:right;}}">
{{Documentation}}
<div class="navbox" style="border:2px solid {{{bdcolor|#525252}}}; text-align:left;background:{{{bgcolor|#323232}}};">
<includeonly>
<div style="text-align:center; padding:.6em; background-color:{{{bgcolor2|#262626}}}; border-bottom: 2px solid {{{bdcolor2|{{{bgcolor2}}}}}}; font-size:1em;position:relative;z-index:1">{{#if: {{{icon|}}} | {{{icon}}} }} '''[[{{#if: {{{link|}}} | {{{link}}} | {{{title}}} }}|{{#if: {{{title|}}} | {{{title}}} | {{{link}}} }}]]'''</div>
<div class="navbox-text" style="position:relative; padding:.8em 3.2em .8em .8em; z-index:1; {{#if: {{{txtcolor|}}} | color: {{{txtcolor|}}} }}">
{{{text}}}
</div>
{{#if: {{{bgimage|}}} | <div style="position:absolute;bottom:2px;z-index:0;overflow:hidden;">[[File:{{{bgimage|}}}{{!}}link={{!}}alt=]]</div> }}
</div>
</div>
</includeonly><noinclude>
Create a floating right navigation box.
== Simple example ==


{{MenuBox
<onlyinclude><div style="position:relative; margin:0 0 1em 1em; {{#if: {{{nofloat|}}} | display:inline-block; | float:right;}}">
|title= Main Page
<div class="navbox" style="border:2px solid {{{bdcolor|#525252}}}; text-align:left;background:{{{bgcolor|#323232}}};">
|icon= [[File:Icon hl2.png|link=Half-Life 2]]
<div style="text-align:center; padding:.6em; background-color:{{{bgcolor2|#262626}}}; border-bottom: 2px solid {{{bdcolor2|#262626}}}; font-size:1em;position:relative;z-index:1">{{#if: {{{icon|}}} | {{{icon}}} }} '''{{#if:{{{nolink|}}}|{{{title|}}}|{{Lx|{{{link|{{{title}}}}}}|{{{title|{{{link}}}}}}}}}}'''</div>
|text=
<div class="navbox-text" style="position:relative; {{#if: {{{nopad|}}} | | padding:.8em 3.2em .8em .8em;}} z-index:1; {{#if: {{{txtcolor|}}} | color: {{{txtcolor|}}} }}">{{{text}}}</div>
# MenuBox List Item 1
</div>
# MenuBox List Item 2
</div></onlyinclude>
# MenuBox List Item 3
# MenuBox List Item 4
# MenuBox List Item 5
# MenuBox List Item 6
# MenuBox List Item 7
}}
<pre>
{{MenuBox
|title= Main Page
|icon= [[File:Icon hl2.png|link=Half-Life 2]]
|text=
# 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
}}</pre>


== All parameters ==
</includeonly>
<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
|bgimage = image to appear in background
|nofloat = set true to appear inline
}}
</pre></noinclude>

Latest revision as of 04:36, 11 May 2025

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

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>
}}