MiniVend Akopia Services

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

Re: interpolation question







On Tue, 6 Jul 1999 mikeh@minivend.com wrote:

> ******    message to minivend-users from mikeh@minivend.com     ******
> 
> Quoting Kyle Hayes (kyle540@quicknet.net):
> > Hi,
> > [interpolation examples snipped]
> > 
> 
> The important thing to know is that you cannot mix positional and named
> parameters in Minivend tags. So [value private_label interpolate=1]
> doesn't do anything like you are expecting -- it just shows the value
> of private_label.

Ah.  This is new to me.

What about [perl values interpolate=1]?  How should this be written?

> Certainly the easiest and most efficient way to do what you apparently
> need is:
> 
> 	[value name=private_label set='[data ....]' ]
> 
> Add a "hide=1" if you don't want it coming back to the page.
> And whatever you do, don't think [value private_label set="[data ...]"] is
> the same....8-)

OK.

> Then, of course you reference it as [value private_label].
> 
> Different tags have different interpolate defaults; [set ...] ... [/set] in
> particular needs to NOT interpolate by default because its most common
> use is to set one-click actions or search profiles. It 
> needs to be
> 
> 	[set name=something interpolate=1]
> 		[sometag]
> 	[/set]
> 
> to interpolate a tag.

Hmm, I didn't know that you could force interpolation on [set].  I am
learning...

> This all is easy to me, I suppose because I understand a little bit how
> UNIX works (and perhaps in small part because I wrote the program ;). Note
> that most UNIX programs don't allow you to mix positional arguments and
> options. This comes natural to me and I forget that it doesn't to others.

I have worked with Unix for the better part of twenty years and programmed
for as long.  I would have taken a long time to guess that you couldn't
mix argument styles because the examples vary all over the place.  I think
I will go back and start making all my tags use the option format instead
as that seems to make things a little more clear to me.

This mix-up could be the root of a large number of small problems I have
run into in the past.

Here is the example in question:

(this should be all on one line)
[data base=private_label field=name key='[data base=reseller_map
field=private_label_id key="[data session source]"]']

This works perfectly in-line in the HTML.  I get the original partner info
(from [data session source]) and then use that as the key to look up a
mapping to a specific private label identifier.  Finally, that identifier
is used to look up the name of the private label entity.  This allows us
to have several resellers that sell off of a smaller number of distinct
brands (or private labels).  We need to track resellers, and we need to
show the private label contact information and branding on the pages.  the
example here is for the name (i.e. XYZ Corp.), but I get a lot of other
information in exactly the same manner.  If I put the above tags directly
into the page HTML, the pages are too slow (the database look ups
take some time).  So, I just want to incur that cost on the index.html
page and store/cache the values for the rest of the session.

How do I put this into a [value...] tag?  I have run out of types of
quotes :-)

What I want is:

(again, should be on one line)
[value name=private_label_name set=?[data base=private_label field=name
key='[data base=reseller_map field=private_label_id key="[data session
source]"]]?]

What should I put in place of the "?"?  Can I use parentheses?

Best,
Kyle




Search for: Match: Format: Sort by: