v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Template:Navbox/doc

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 5: Line 5:
  
 
<pre style="overflow: auto;">{{Navbox
 
<pre style="overflow: auto;">{{Navbox
| name  = {{subst:PAGENAME}}{{subst:null|Don't change anything on this line. It will change itself when you save.}}
+
| name  = {{subst:PAGENAME}}{{subst:void|Don't change anything on this line. It will change itself when you save.}}
 
| title =
 
| title =
 
| state = {{{state|}}}
 
| state = {{{state|}}}
Line 20: Line 20:
 
| list3  =
 
| list3  =
  
<!-- ... (up to group30 & list30) -->
+
<!-- ... (up to group20 & list20) -->
  
 
| below =
 
| below =
Line 27: Line 27:
  
 
==Parameters==
 
==Parameters==
 +
''WIP''
 
===Setup parameters===
 
===Setup parameters===
: <code>name</code> — the title portion of the template's page location, i.e. <code><nowiki>[[Template:NAME HERE]]</nowiki></code>. Required for the top-left navbar to work properly.
+
: <code>name</code>
::When creating a new navbox, you can set this parameter to <code><nowiki>{{subst:PAGENAME}}</nowiki></code>; this will automatically turn into the template's name when you save your changes.
+
: <code>state</code>
: <code>state</code> — sets the initial collapsed state. Common values include <code>autocollapse</code>, <code>collapsed</code>, <code>uncollapsed</code> and <code>expanded</code>. Defaults to <code>autocollapse</code>. It is strongly recommended to set this parameter to <code><nowiki>{{{state|}}}</nowiki></code>, as this allows users to change the navbox's state locally, e.g. <code><nowiki>{{Creatures|state=expanded}}</nowiki></code>.
+
: <code>navbar</code>
:: <code>autocollapse</code> — hides the content if there is another collapsible element on the page. Otherwise, it shows the content.
 
:: <code>collapsed</code> — hides the content.
 
:: <code>expanded</code> or <code>uncollapsed</code> — shows the content.
 
: <code>navbar</code> — disables the navigation links on the top-left. Only accepts <code>off</code>.
 
: <code>border</code> or <code>{{{1}}}</code> — accepted values are <code>subgroup</code> and <code>child</code>. See [[#Child navboxes|§ Child navboxes]].
 
  
 
===Cells===
 
===Cells===
: <code>title</code> — title text.
+
: <code>title</code>
: <code>above</code> — text between the title bar and the first group/list.
+
: <code>above</code>
: <code>group<sub>n</sub></code> (''group1'', ''group2'', ... , ''group30'') — text displayed inside a box on the left side of its ''list''. Can be omitted. It won't display if its ''list'' is empty or undefined.
+
: <code>group<sub>n</sub></code>
: <code>list<sub>n</sub></code> (''list1'', ''list2'', ... , ''group30'') — main content, usually a list of links. Unlike ''group'', it can exist on its own; if ''group'' is omitted, the text will be centered.
+
: <code>list<sub>n</sub></code>
: <code>below</code> — footer text (bar below groups and lists).
+
: <code>below</code>
  
 
===Style parameters===
 
===Style parameters===
Quotations ("") or <code>style=</code> are unnecessary.
+
: <code>bodystyle</code>
 
+
: <code>titlestyle</code>
: <code>bodystyle</code> — CSS style for the <nowiki><table></nowiki> element.
+
: <code>basestyle</code>
: <code>titlestyle</code> — CSS style for the title bar.
+
: <code>abovestyle</code>
: <code>basestyle</code> — Combination of titlestyle, abovestyle, belowstyle and groupstyle. Overwritten by titlestyle, abovestyle, belowstyle, groupstyle and group<sub>n</sub>style.
+
: <code>belowstyle</code>
: <code>abovestyle</code> — CSS style for the above bar.
+
: <code>groupstyle</code>
: <code>belowstyle</code> — CSS style for the below bar.
+
: <code>group<sub>n</sub>style</code>
: <code>groupstyle</code> — CSS style for all group boxes.
+
: <code>liststyle</code>
: <code>group<sub>n</sub>style</code> — CSS style for a specific group box, where <sub>n</sub> denotes the group (group1style → group1, etc.).
+
: <code>list<sub>n</sub>style</code>
: <code>liststyle</code> —  CSS style for all lists.
+
: <code>listpadding</code>
: <code>list<sub>n</sub>style</code> — CSS style for a specific list, where <sub>n</sub> denotes the list (list1style → list1, etc.).
 
: <code>listpadding</code> — sets the padding for lists. Default is <code>0em 0.25em</code>.
 
  
 
====Default styles====
 
====Default styles====
 
<syntaxhighlight lang="css">
 
<syntaxhighlight lang="css">
bodystyle  = background: #fdfdfd; border: 1px solid #aaa; font-size: 88%; margin: 0 auto -1px; vertical-align: middle; width: 60%;
+
bodystyle  = background: #fdfdfd; border: 1px solid #aaa; font-size: 90%; margin: 0 auto -1px; vertical-align: middle; width: 60%;
 
titlestyle = background: #ccccff; border: 1px solid #aaa; padding: 0.25em 1em; text-align: center;
 
titlestyle = background: #ccccff; border: 1px solid #aaa; padding: 0.25em 1em; text-align: center;
 
abovestyle = background: #ddddff; padding: 0.25em 1em; text-align: center;
 
abovestyle = background: #ddddff; padding: 0.25em 1em; text-align: center;
Line 116: Line 110:
 
| name  = Navbox/doc
 
| name  = Navbox/doc
 
| title = [[Soil]]
 
| title = [[Soil]]
| state = expanded
+
| state = {{{state|expanded}}}
| navbar = off
+
| titlestyle = background-color: #c0e1d1;
| titlestyle = background-color: #FFFF00;
+
| basestyle = background-color: #b0cabd;
| basestyle = background-color: #C0C0C0;
 
  
 
| group1 = Topsoil
 
| group1 = Topsoil
 
| list1  = [[Loam]] • [[Loamy sand]] • [[Peat]] • [[Sandy clay loam]] • [[Sandy loam]] • [[Silt]] • [[Silt loam]] • [[Silty clay loam]]
 
| list1  = [[Loam]] • [[Loamy sand]] • [[Peat]] • [[Sandy clay loam]] • [[Sandy loam]] • [[Silt]] • [[Silt loam]] • [[Silty clay loam]]
  
| group2style = background-color: #00FFFF; color: white;
 
 
| group2 = Ocean floor
 
| group2 = Ocean floor
 
| list2  = [[Calcareous ooze]] • [[Pelagic clay]] • [[Siliceous ooze]]
 
| list2  = [[Calcareous ooze]] • [[Pelagic clay]] • [[Siliceous ooze]]
Line 132: Line 124:
  
 
| group4 = Clay
 
| group4 = Clay
| list4style = border: 1px solid black; font-size: 114%;
 
 
| list4  = [[Clay]] • [[Clay loam]] • [[Fire clay]] • [[Sandy clay]] • [[Silty clay]]
 
| list4  = [[Clay]] • [[Clay loam]] • [[Fire clay]] • [[Sandy clay]] • [[Silty clay]]
  
Line 142: Line 133:
 
| name  = Navbox/doc
 
| name  = Navbox/doc
 
| title = [[Soil]]
 
| title = [[Soil]]
| state = expanded
+
| state = {{{state|expanded}}}
| navbar = off
+
| titlestyle = background-color: #c0e1d1;
| titlestyle = background-color: #FFFF00;
+
| basestyle = background-color: #b0cabd;
| basestyle = background-color: #C0C0C0;
 
  
 
| group1 = Topsoil
 
| group1 = Topsoil
 
| list1  = [[Loam]] • [[Loamy sand]] • [[Peat]] • [[Sandy clay loam]] • [[Sandy loam]] • [[Silt]] • [[Silt loam]] • [[Silty clay loam]]
 
| list1  = [[Loam]] • [[Loamy sand]] • [[Peat]] • [[Sandy clay loam]] • [[Sandy loam]] • [[Silt]] • [[Silt loam]] • [[Silty clay loam]]
  
| group2style = background-color: #00FFFF; color: white;
 
 
| group2 = Ocean floor
 
| group2 = Ocean floor
 
| list2  = [[Calcareous ooze]] • [[Pelagic clay]] • [[Siliceous ooze]]
 
| list2  = [[Calcareous ooze]] • [[Pelagic clay]] • [[Siliceous ooze]]
Line 158: Line 147:
  
 
| group4 = Clay
 
| group4 = Clay
| list4style = border: 1px solid black; font-size: 114%;
 
 
| list4  = [[Clay]] • [[Clay loam]] • [[Fire clay]] • [[Sandy clay]] • [[Silty clay]]
 
| list4  = [[Clay]] • [[Clay loam]] • [[Fire clay]] • [[Sandy clay]] • [[Silty clay]]
  
Line 165: Line 153:
  
 
==Child navboxes==
 
==Child navboxes==
===Usage===
+
''TBD''
<pre style="overflow: auto;">{{Navbox
 
| name = {{subst:PAGENAME}}
 
| title = Title
 
 
 
| group1 = [optional]
 
| list1  = {{Navbox|child
 
  ...child navbox parameters...
 
}}
 
 
 
...
 
}}
 
</pre>
 
 
 
===Multiple subgroups example===
 
<pre style="overflow: auto;">{{Navbox
 
| name  = Navbox/doc
 
| title = Multiple subgroups example
 
| state = expanded
 
| above = Above
 
 
 
| group1 = Group 1
 
| list1 = List 1
 
 
 
| group2 = Group 2
 
| list2 = {{Navbox|child
 
  | group1 = Group 2.1
 
  | list1 = List 2.1
 
  | list2 = List 2.2 ''without Group 2.2''
 
  | group3 = Group 2.3
 
  | list3 = List 2.3
 
}}
 
 
 
| group3 = Group 3
 
| list3 = List 3
 
 
 
| group4 = Group 4
 
| list4 = {{Navbox|child
 
  | group1 = Group 4.1
 
  | list1 = List 4.1
 
  | group2 = Group 4.2
 
  | list2 = {{Navbox|child
 
    | group1 = Group 4.2.1
 
    | list1 = List 4.2.1
 
    | group2 = Group 4.2.2
 
    | list2 = {{Navbox|child
 
      | group1 = Group 4.2.2.1
 
      | list1 = List 4.2.2.1
 
    }}
 
    | group3 = Group 4.2.3
 
    | list3 = List 4.2.3
 
  }}
 
  | group3 = Group 4.3
 
  | list3 = List 4.3
 
}}
 
 
 
| below = Below
 
}}
 
</pre>
 
 
 
{{Navbox
 
| name  = Navbox/doc
 
| title = Multiple subgroups example
 
| state = expanded
 
| above = Above
 
 
 
| group1 = Group 1
 
| list1 = List 1
 
 
 
| group2 = Group 2
 
| list2 = {{Navbox|child
 
  | group1 = Group 2.1
 
  | list1 = List 2.1
 
  | list2 = List 2.2 ''without Group 2.2''
 
  | group3 = Group 2.3
 
  | list3 = List 2.3
 
}}
 
 
 
| group3 = Group 3
 
| list3 = List 3
 
 
 
| group4 = Group 4
 
| list4 = {{Navbox|child
 
  | group1 = Group 4.1
 
  | list1 = List 4.1
 
  | group2 = Group 4.2
 
  | list2 = {{Navbox|child
 
    | group1 = Group 4.2.1
 
    | list1 = List 4.2.1
 
    | group2 = Group 4.2.2
 
    | list2 = {{Navbox|child
 
      | group1 = Group 4.2.2.1
 
      | list1 = List 4.2.2.1
 
    }}
 
    | group3 = Group 4.2.3
 
    | list3 = List 4.2.3
 
  }}
 
  | group3 = Group 4.3
 
  | list3 = List 4.3
 
}}
 
 
 
| below = Below
 
}}
 
 
 
===Collapsible subgroups example===
 
<pre style="overflow: auto;">{{Navbox
 
| name  = Navbox/doc
 
| title  = Collapsible subgroups example
 
| state  = expanded
 
 
 
| list1  = {{Navbox|child
 
  | title  = Collapsible subgroup 1
 
  | group1 = Group 1.1
 
  | list1  = List 1.1
 
  | group2 = Group 1.2
 
  | list2  = List 1.2
 
}}
 
 
 
| list2  = {{Navbox|child
 
  | title  = Collapsible subgroup 2
 
  | state  = expanded
 
  | above  = Above
 
  | group1 = Group 2.1
 
  | list1  = List 2.1
 
  | group2 = Group 2.2
 
  | list2  = List 2.2
 
  | below  = Below
 
}}
 
 
 
| group3 = Group 3
 
| list3  = {{Navbox|child
 
  | title  = Collapsible subgroup 3
 
  | group1 = Group 3.1
 
  | list1  = List 3.1
 
  | group2 = Group 3.2
 
  | list2  = List 3.2
 
}}
 
}}
 
</pre>
 
 
 
{{Navbox
 
| name  = Navbox/doc
 
| title  = Collapsible subgroups example
 
| state  = expanded
 
 
 
| list1  = {{Navbox|child
 
  | title  = Collapsible subgroup 1
 
  | group1 = Group 1.1
 
  | list1  = List 1.1
 
  | group2 = Group 1.2
 
  | list2  = List 1.2
 
}}
 
 
 
| list2  = {{Navbox|child
 
  | title  = Collapsible subgroup 2
 
  | state  = expanded
 
  | above  = Above
 
  | group1 = Group 2.1
 
  | list1  = List 2.1
 
  | group2 = Group 2.2
 
  | list2  = List 2.2
 
  | below  = Below
 
}}
 
  
| group3 = Group 3
+
<includeonly>[[Category:Navigation templates|*]]</includeonly>
| list3  = {{Navbox|child
 
  | title  = Collapsible subgroup 3
 
  | group1 = Group 3.1
 
  | list1  = List 3.1
 
  | group2 = Group 3.2
 
  | list2  = List 3.2
 
}}
 
}}<includeonly>[[Category:Navigation templates|*]]</includeonly>
 
 
<noinclude>[[Category:Template Documentation]]</noinclude>
 
<noinclude>[[Category:Template Documentation]]</noinclude>

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Templates used on this page: