[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Difficulty understanding interpolation
****** message to minivend-users from Matt Paladino <matt@la.razorfish.com> ******
The only way I was able to do it was by creating global subs in
minivend.cfg.
Example:
This code would go in your html doc. It would call a global sub routine
called "get_searchspec", which would pass the value of mv_searchspec.
[perl arg=sub interpolate=1]
get_searchspec( [value mv_searchspec] )
[/perl]
This goes in minivend.cfg
GlobalSub <<EOT
sub get_searchspec {
# Read in the value of mv_searchspec
my (@search_stuff) = @_;
# Turn $search_stuff into scalar $company
my $company = ($search_stuff);
# Turn $company into a scratch variable [company]
$Vend::Session->{'scratch'}->{'company'} = $company;
return;
}
EOT
Then in your html, [scratch company] will return the value of
mv_searchspec. (In theory)
I say "In theory" because is took my about 3 weeks to figure out how to
pass variable from Minivend to Perl Subs and then back out to Minivend.
It's a bitch Chris, but I did get it to work.
[set] does not interpolate as far as I know, and I've been messing with
minivend for about 8 months consistently.
Maybe Mike will add that feature in.
Good luck.
Matt
| || ||| || r a z o r f i s h , los angeles
matt paladino
[ senior developer ]
>> 310.581.3616 x 160
On Wed, 16 Dec 1998, Chris Powell wrote:
> ****** message to minivend-users from Chris Powell <helios@brickandivy.com> ******
>
> I'm afraid I've run into what is probably a fairly simple problem to
> solve -- I'm relatively new to Minivend, thus still learning my way.
>
> Let's say my user searches for a certain manufacturer. On my
> results.html page I want it to say something like:
>
> We carry a full line of Kelty products!
>
> which I accomplish via:
>
> We carry a full line of [value mv_searchspec] products!
>
> The problem is, if there the user follows a [more] tag link,
> mv_searchspec gets nulled. I've tried to get mv_searchspec set into a
> non-volatile scratch variable on the first results page by doing this:
>
> [set mv_put_session]Yes[/set]
> [set company]
> [value mv_searchspec]
> [/set]
>
> but that is not working due to, I believe, the order things get
> interpolated. That is, my variable 'company' actually gets set to the
> string "[value mv_searchspec]" ...
>
> Is there a straightforward way to pull mv_* vars into my scratch space
> for preservation?
>
> Thanks for the help,
> Chris Powell
> --
> Christopher Powell Brick and Ivy Corporate Consulting
> helios@brickandivy.com http://www.brickandivy.com/
>
> finger for PGP public key
> talk helios@jezebel.brickandivy.com
>
>
> -
> 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
>
-
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