This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Template:LinkBar"

From OWASP
Jump to: navigation, search
(Made second parameters of inner templates optional)
(Added documentation)
Line 1: Line 1:
<div align="center">
+
<noinclude>==Purpose==
 +
 
 +
Generates a bar that can contain navigation links of "Previous", "Main" and "Next" type.
 +
 
 +
The links themselves are generated by including other templates into this template. The names of the inner templates are passed as parameters.
 +
 
 +
==Usage==
 +
 
 +
<pre>{{LinkBar
 +
  | useprev=PREV_LINK_TEMPLATE | prev=PREV_LINK_TARGET | lblprev=PREV_LINK_LABEL
 +
  | usemain=MAIN_LINK_TEMPLATE | main=MAIN_LINK_TARGET | lblmain=MAIN_LINK_LABEL
 +
  | usenext=NEXT_LINK_TEMPLATE | next=NEXT_LINK_TARGET | lblnext=NEXT_LINK_LABEL
 +
}}</pre>
 +
 
 +
If the lbl* parameters are omitted or empty, the targets of the links will be used as labels, too.
 +
 
 +
==Inner Template Requirements==
 +
 
 +
The inner templates are expected to generate a link, possibly with ornamentation (arrows, extra text,...). The inner templates must accept one or two parameters, the first one for the target of the link, the second one for the label of the link. If the second parameter is missing or empty, the inner template must use the link's target as label.
 +
</noinclude>
 +
<includeonly><div align="center">
 
{|width="100%" "style="border:0px;"
 
{|width="100%" "style="border:0px;"
 
|-<!--COLUMN HEADINGS-->
 
|-<!--COLUMN HEADINGS-->
Line 15: Line 35:
 
                                         }}
 
                                         }}
 
|}
 
|}
</div>
+
</div></includeonly>

Revision as of 15:54, 8 September 2010

Purpose

Generates a bar that can contain navigation links of "Previous", "Main" and "Next" type.

The links themselves are generated by including other templates into this template. The names of the inner templates are passed as parameters.

Usage

{{LinkBar
  | useprev=PREV_LINK_TEMPLATE | prev=PREV_LINK_TARGET | lblprev=PREV_LINK_LABEL
  | usemain=MAIN_LINK_TEMPLATE | main=MAIN_LINK_TARGET | lblmain=MAIN_LINK_LABEL
  | usenext=NEXT_LINK_TEMPLATE | next=NEXT_LINK_TARGET | lblnext=NEXT_LINK_LABEL
}}

If the lbl* parameters are omitted or empty, the targets of the links will be used as labels, too.

Inner Template Requirements

The inner templates are expected to generate a link, possibly with ornamentation (arrows, extra text,...). The inner templates must accept one or two parameters, the first one for the target of the link, the second one for the label of the link. If the second parameter is missing or empty, the inner template must use the link's target as label.