Difference between revisions of "Template:Navbar/doc"

From Define Wiki
Jump to navigation Jump to search
m (1 revision)
 
(No difference)

Latest revision as of 12:29, 14 June 2012

{{#ifeq: doc | doc

 | 

{{

   #ifeq: show | show
   | {{
 {{#switch:
 {{#if: 
   | 
   | {{#if: 
     | 
       {{#ifeq:|
       | talk
       |  
       }}
     | 
       {{#ifeq:template|template talk
       | talk
       | template 
       }}
     }}
   }}

| main | = ambox | talk = tmbox | user = ombox | wikipedia = ombox | file | image = imbox | mediawiki = ombox | template = ombox | help = ombox | category = cmbox | portal = ombox | book = ombox | other | #default = ombox

}} | type = notice | image = 40px | imageright = | class = | style = | textstyle = | text = This is a documentation subpage for Template:Navbar.
It contains usage information, categories, interlanguage links and other content that is not part of the original {{ #if: | {{{text2}}} | {{ #if: | {{{text1}}} | {{ #ifeq: Template | User | template template page | {{ #if: Template |template page|article}}}}}}}}. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = }}

   }}{{
   #if: 
   | 
   | {{#ifexist:Template:Navbar|[[Category:{{
     #switch: Template
     | Template  = Template
     | User      = User
     | #default  = Wikipedia
   }} documentation pages]]|}}
 }}

| }} {{#ifeq:|yes

|

{{#ifeq:{{#if:| {{{smallimage}}} | }}|none | | }}

{{#if:{{#if: | {{{smallimageright}}} | }} | {{#ifeq:{{#if: | {{{smallimageright}}} | }}|none

 | 
|
 }}

}}

{{#switch:content

| | speedy | delete | content | style | move | protection | notice =

| #default =

This message box is using an invalid "type=content" parameter and needs fixing.

}}

|

{{#ifeq:|none | | }}

{{#if: | {{#ifeq:|none

 | 
|
 }}

}}

{{#switch:content

| | speedy | delete | content | style | move | protection | notice =

| #default =

This message box is using an invalid "type=content" parameter and needs fixing.

}} }}

Usage

General

When one of the following examples is placed inside a given template, it adds navbar navigational functionality:

{{navbar|{{subst:PAGENAME}}|mini=1}}
{{navbar|{{subst:PAGENAME}}|plain=1}}
{{navbar|{{subst:PAGENAME}}|fontstyle=color:green}}

The {{subst:PAGENAME}} will be substituted with the template's name when parsed by the servers. For example, {{navbar|navbar/doc}} gives:

Font-size

Font-size is 88% when used in a navbar, and 100% when nested in a navbox. In the navbar, the weight is "normal"; when nested in navbox, it takes on the outer setting. The middot is bold.

Examples

Required parameters

  • {{navbar|Template Name}} – the template name is required.

Optional parameters

Options Parameters Produces...
Basic {{navbar|Template Name}} [}}
  • [[{{#switch:
#default = Navbar/doc =
   {{#ifeq:  | 
Template:navbar/doc Navbar/doc
   }}
}}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}
    Different text {{navbar|Template Name|text=This template:}} [}}
    • [[{{#switch:
    #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}
    Without "This box:" text {{navbar|Template Name|plain=1}} [}}
    • [[{{#switch:
    #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}
    Short version {{navbar|Template Name|mini=1}} [}}
    • [[{{#switch:
    #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|{{#if:1|v|view}}]]
  • [[|{{#if:1|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:1|e|edit}}]}}{{#if:|]}}
    With brackets {{navbar|Template Name|brackets=1}} [}}
    • [[{{#switch:
    #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:1|]}}
    With a color option (span) {{navbar|Template Name|fontstyle=color:green}} [}}
    • [[{{#switch:
    #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}
    To float to the side (div) {{navbar|Template Name|style=float:right}} [}}
    • [[{{#switch:
    #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navbar/doc =
       {{#ifeq:  | 
    
    Template:navbar/doc Navbar/doc
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}

    Deprecated parameters

    The miniv=1, viewplain=1, nodiv=1 and fontcolor= parameters have been deprecated. To implement the view-only version, use the {{{{#if:|subst:}}v{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} or {{{{#if:|subst:}}view{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} templates instead.

    Notes

    Navbar is contained within a {{#switch:pair

    |c|close  = 
    |s|single
    |o|open
    |p|pair   = <div{{#if:| {{{params}}}}}
    

    }}{{#switch:pair

    |c|close  = 
    |s|single =  />
    |o|open   = >
    |p|pair   = >...
    

    }}{{#switch:pair

    |s|single
    |o|open   = 
    |c|close
    |p|pair   = </div>
    

    }} in order to accommodate a horizontal unnumbered list. This means it cannot be placed inside a {{#switch:pair

    |c|close  = 
    |s|single
    |o|open
    |p|pair   = <span{{#if:| {{{params}}}}}
    

    }}{{#switch:pair

    |c|close  = 
    |s|single =  />
    |o|open   = >
    |p|pair   = >...
    

    }}{{#switch:pair

    |s|single
    |o|open   = 
    |c|close
    |p|pair   = </span>
    

    }} or other inline element, because Tidy will 'fix' situations where it finds block elements inside inline elements.

    Prepackaged

    {{Tnavbar-header}}
    Positions
    |#default = Navbar/doc 
    | = 
       {{#ifeq:  | 
         | Template:navbar/doc            
         | Navbar/doc      
       }}
    

    }}|{{#if:1|v|view}}]]

  • [[|{{#if:1|t|talk}}]]
  • {{#if:||

  • [{{fullurl:{{#switch: |#default = Navbar/doc | = {{#ifeq: | | Template:navbar/doc | Navbar/doc }} }}|action=edit}} {{#if:1|e|edit}}]
  • }}{{#if:|]}} on the right edge of the line, often used in non-collapsible navbox heading.

    {{Tnavbar-navframe}}
    For use in conjunction with Navframe divs, positions
    |#default = Navbar/doc 
    | = 
       {{#ifeq:  | 
         | Template:navbar/doc            
         | Navbar/doc      
       }}
    

    }}|{{#if:1|v|view}}]]

  • [[|{{#if:1|t|talk}}]]
  • {{#if:||

  • [{{fullurl:{{#switch: |#default = Navbar/doc | = {{#ifeq: | | Template:navbar/doc | Navbar/doc }} }}|action=edit}} {{#if:1|e|edit}}]
  • }}{{#if:|]}} opposite of the [hide]/[show] feature.

    {{Tnavbar-collapsible}}
    For use in conjunction with Collapsible tables, floats
    |#default = Navbar/doc 
    | = 
       {{#ifeq:  | 
         | Template:navbar/doc            
         | Navbar/doc      
       }}
    

    }}|{{#if:1|v|view}}]]

  • [[|{{#if:1|t|talk}}]]
  • {{#if:||

  • [{{fullurl:{{#switch: |#default = Navbar/doc | = {{#ifeq: | | Template:navbar/doc | Navbar/doc }} }}|action=edit}} {{#if:1|e|edit}}]
  • }}{{#if:|]}} opposite of the [hide]/[show] feature.

    See also

    • {{Ed}} – navbar style edit link
    • {{Ed right}} – navbar style edit link aligned to right of page
    • {{Edit}} – plain edit link
    • {{Edit section}} – edit link aligned to right of page

    With additional links:

    Navigation templates comparison
    [}}
    • [[{{#switch:
    #default = Navigation templates =
       {{#ifeq:  | 
    
    Template:Navigation templates Navigation templates
       }}
    
    }}|{{#if:|v|view}}]]
  • [[|{{#if:|t|talk}}]]
  • {{#if:||
  • [{{fullurl:{{#switch:
  • #default = Navigation templates =
       {{#ifeq:  | 
    
    Template:Navigation templates Navigation templates
       }}
    
    }}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}
    Collapsible Header color Image Groups Style (body)
    parameter/s
    Examples
    {{Navbox}} collapsible navbox Left/right of body Yes Yes
    {{Navbox with collapsible groups}} collapsible navbox Left/right of body and/or in each list Yes Yes
    {{Navbox with columns}} collapsible navbox Left/right of columns No Yes
    {{Navbox years}} collapsible navbox No No No
    Collapsible attributes
    Type CSS classes Javascript Collapses when Custom
    initial state
    Nesting
    Collapsible tables collapsible Defined in Common.js 2 or more autocollapse on page Yes Yes