[ic] form in area tag, good except

Mike Heins interchange-users@interchange.redhat.com
Fri Jun 7 07:03:00 2002


Quoting Mike Heins (mike@valuemedia.com):
> Quoting Paul Jordan (paul@gishnetwork.com):
> > >From what I can make out, the above [calc] would have to be inside the
> > [flylist] to interpolate. My "switch to" buttons are [included] within the
> > top template. I tried various things like substituting with
> > 
> > $Scratch->{page_arg} = q{[fly-list code="[data session
> > arg]"][item-code][/fly-list]};
> > 
> > and
> > 
> > $Scratch->{page_arg} = q{[fly-list interpolate=1 code="[data session
> > arg]"][item-code][/fly-list]};
> > 
> > 
> > But no luck. This train of thought made me try other ways similar to this,
> > but they all seem to revolve around being able to reference a fly-list
> > [item-code], outside and before the fly-list itself.
> > 
> > Can someone shed some light on how I can get
> > 
> > [fly-list code="[data session arg]"][item-code][/fly-list]
> > 
> > or similar to interpolate in the top template.
> > 
> 
> I would suggest this one-line global UserTag:
> 
>     UserTag flycode Routine sub { return $Vend::Flypart }
> 
> Then [flycode] will yield an empty string if it is not a flypage,
> and the item code if it is. Change your calc to:
> 
>  [calc]
> 	$Scratch->{page_arg} = $Tag->flycode();
> 	unless ($Scratch->{page_arg}) {
> 		$Scratch->{page_arg} = q{@@MV_PAGE@@};
> 	}
> 	return;
>  [/calc]
> 
> Then it should work anywhere on the page.

Oops, just realized it may not work in a Variable. Change the call to
MV_PAGE to:

 	$Scratch->{page_arg} = $Tag->var('MV_PAGE', 1);

-- 
Mike Heins
Perusion -- Expert Interchange Consulting
phone +1.513.523.7621      <mike@perusion.com>

Light travels faster than sound. This is why some people appear bright
until you hear them speak. -- unknown