6.1. bar_button

Displays content based on current page. Could be used for building e.g. menu bars.

6.1.1. Summary

    [bar-button page current]...[selected]...[/selected][/bar-button]
    [bar-button page=page current=current-page]...[selected]...[/selected][/bar-button]

Positional parameters: The first line shows the usage with positional parameters (given in order). The second line shows usage with named parameters.

Parameters Description Default
page Name of page for which this bar-button is defined none
current Name of the current page Current page: MV_PAGE
Invalidates cache No
Macro No
Has end tag [/bar-button]

Tag expansion example:

To build a simple '3-button' menu bar one could put the following on each of the pages. The results of this code for page2 are shown below.

        [bar-button page=page1]
        <TD><A HREF="[area page1]">PAGE-1</A></TD>
        <TD bgcolor="red"><A HREF="[area page1]"><B>PAGE-1-selected</B></A></TD>
        [bar-button page=page2]
        <TD><A HREF="[area page2]">PAGE-2</A></TD>
        <TD bgcolor="red"><A HREF="[area page2]"><B>PAGE-2-selected</B></A></TD>
        [bar-button page=page3]
        <TD><A HREF="[area page3]">PAGE-3</A></TD>
        <TD bgcolor="red"><A HREF="[area page3]"><B>PAGE-3-selected</B></A></TD>
        PAGE-1    PAGE-2-selected    PAGE-3

ASP-like Perl call:

    $Tag->button_bar(  { page => $page,
                     current  => $current,
                         body => $body}  );

or similarly,

    $Tag->area($page, $current, $body); See Also

bar_link routine

6.1.2. Description

Displays content based on current page. The content between the [selected][/selected] tags will be displayed only if the name of the current page matches the name that was passed to the page parameter (page=page-name). The default content will be displayed when there is no match. page

The name of the page for which this definition of the bar-button is defined. current

The name of the current page. Defaults to current page MV_PAGE.