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
(Added documentation)
(Changed to explicitly numbered parameters when calling inner templates in order to prevent whitespace around parameter from confusing them.)
Line 23: Line 23:
 
|-<!--COLUMN HEADINGS-->
 
|-<!--COLUMN HEADINGS-->
 
| width="33%" style="text-align:left;"|{{ #if: {{{lblprev|}}}
 
| width="33%" style="text-align:left;"|{{ #if: {{{lblprev|}}}
                                           | {{ {{{useprev}}} | {{{prev}}} | {{{lblprev}}} }}  
+
                                           | {{ {{{useprev}}} | 1={{{prev}}} | 2={{{lblprev}}} }}  
                                           | {{ {{{useprev}}} | {{{prev}}} }}
+
                                           | {{ {{{useprev}}} | 1={{{prev}}} }}
 
                                       }}
 
                                       }}
 
| width="33%" style="text-align:center;"|{{ #if: {{{lblmain|}}}
 
| width="33%" style="text-align:center;"|{{ #if: {{{lblmain|}}}
                                             | {{ {{{usemain}}} | {{{main}}} | {{{lblmain}}} }}
+
                                             | {{ {{{usemain}}} | 1={{{main}}} | 2={{{lblmain}}} }}
                                             | {{ {{{usemain}}} | {{{main}}} }}
+
                                             | {{ {{{usemain}}} | 1={{{main}}} }}
 
                                       }}
 
                                       }}
 
| width="33%" style="text-align:right;"|{{ #if: {{{lblnext|}}}
 
| width="33%" style="text-align:right;"|{{ #if: {{{lblnext|}}}
                                           | {{ {{{usenext}}} | {{{next}}} | {{{lblnext}}} }}  
+
                                           | {{ {{{usenext}}} | 1={{{next}}} | 2={{{lblnext}}} }}  
                                           | {{ {{{usenext}}} | {{{next}}} }}
+
                                           | {{ {{{usenext}}} | 1={{{next}}} }}
 
                                         }}
 
                                         }}
 
|}
 
|}
 
</div></includeonly>
 
</div></includeonly>

Revision as of 16:10, 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.