[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Determining [page] attributes
****** message to minivend-users from mikeh@minivend.com ******
Quoting August Detlefsen (augustd@idiom.com):
>
> I want to include a standard set of header and footer html in a site (ie for
> the buttons and common graphical elements) using the [include] tag. Is there
> a way for elements of the header and footer to know what page they are
> embedded on? For example, so the 'Search' button will be disabled when the
> header is included on srchform.html.
>
I had been meaning to do this one for a long time, so I put it in
minivend.cfg for the 3.12 demo:
UserTag bar-button Order page current
UserTag bar-button PosNumber 2
UserTag bar-button HasEndTag 1
UserTag bar-button Routine <<EOR
sub {
use strict;
my ($page, $current, $html) = @_;
$current = $Global::Variable->{MV_PAGE}
if ! $current;
$html =~ s:\[selected\]([\000-\377]*?)\[/selected]::ig;
my $alt = $1;
return $html if $page ne $current;
return $alt;
}
EOR
This is called with something like:
[bar-button srchform]
<A HREF="[area srchform]">Power Search</A>
[selected]
<B>Power Search</B>
[/selected]
[/bar-button]<BR>
Perhaps even more interestingly:
[bar-button page=Renaissance
current="[value mv_searchspec]"]
<A HREF="[area scan
di=category
df=yes
dl=Renaissance
]">Renaissance</A>
[selected]
<B>Renaissance</B>
[/selected]
[/bar-button]
This last one solves the real problem that would be difficult
to solve with static HTML; doing it dynamically based on a search.
It will be in the next beta upload, probably this weekend sometime; but
if you want it sooner it is all right here. Did I ever mention that
I think UserTag is pretty powerful? Thanks to Perl, that is. 8-)
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
131 Willow Lane, Floor 2 | || _ \
It's a little-known fact Oxford, OH 45056 | || |_) |
that the Y1K problem caused <mikeh@minivend.com> |___| _ <
the Dark Ages. -- unknown 513.523.7621 FAX 7501 |_| \_\
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list