MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[MV] MV4.0alpha4 -- Accessing variables in UserTag



Hi All,

I am struggling with the implementation of a usertag.

When I put the code of the usertag directly in a page (e.g.
[perl] tags
 or [mvasp] tags), the code does work, however, when I use that
same code
 in the body of a usertag I run into problems.

See code below and the error message I get when restarting the MV
server.

I guess it all boiles down to how to access the variables set in
catalog.cfg
(like: Variable myvar value) in a usertag.

Tried also:
$Config->{'Variable'}-{'varname'}
This works okay in between [perl] tags but not in UserTag
definition.

Probably I am missing out on something obvious. Any pointers are
welcome.

Any ideas?

Thanks a million.

Ton

Code:
-----
UserTag Look_and_Feel Order theme
UserTag Look_and_Feel Routine <<EOLFCODE
sub {
    my $theme = shift @_;
    foreach (sort keys %$Variable) {
 next unless /^LF_/i;
 my @themes = split /\s+/, $Variable->{ $_ };
 next if $theme > $#themes || $theme < 0;
 s/^LF_//i;
 $Variable->{$_} = $themes[$theme];
    }
}
EOLFCODE


Error Message:
--------------
MiniVend V4.0alpha4
Configuring catalog simple...UserTag 'Look_and_Feel' code is not
a subroutine reference
In line 311 of the configuration file 'catalog.cfg':
UserTag Look_and_Feel Routine <<EOLFCODE
done.
MiniVend server started in INET and UNIX mode(s) (process id
1624)




Search for: Match: Format: Sort by: