bar-button — display content (usually a menu bar) based on page name


Attribute Pos. Req. Default Description
page Yes Yes   Name of the page for which the button is defined.
current Yes   Current page name (as obtained from MV_PAGE). Name of the current page. Usually you do not want to override the default.
interpolate     0 interpolate input?
reparse     1 interpolate output?
hide     0 Hide the tag return value?


This tag can display content depending on current (or provided) page name. It is most directly useful for creating menu bars (although other uses are not excluded).

The content between the [selected][/selected] tags will be displayed if the name of the current page (MV_PAGE variable, or your custom current argument) matches the page parameter.

The default content (one outside of [select] tags) will be displayed when there is no match.


This tag appears to be affected by, or affects, the following:
Global Variables: MV_PAGE


Example: Create 3-button menubar

Create three different pages, page1.html, page2.html and page3.html, each with the identical content:


[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>




bar-button is available in Interchange versions:

4.6.0-5.9.0 (git-head)


Interchange 5.9.0:

Source: code/UserTag/bar_button.tag
Lines: 25

# Copyright 2003-2007 Interchange Development Group and others
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# $Id: bar_button.tag,v 1.5 2007-03-30 23:40:56 pajamian Exp $

UserTag bar-button Order     page current
UserTag bar-button PosNumber 2
UserTag bar-button HasEndTag 1
UserTag bar-button Version   $Revision: 1.5 $
UserTag bar-button Routine   <<EOR
sub {
use strict;
my ($page, $current, $html) = @_;
$current = $Global::Variable->{MV_PAGE}
if ! $current;
$html =~ s!\[selected\]((?s:.)*)\[/selected]!!i;
my $alt = $1;
return $html if $page ne $current;
return $alt;


Interchange Development Group


DocBook! Interchange!