[ic] interchanging data between page and include

Tim Böckers interchange-users@interchange.redhat.com
Thu Apr 4 18:12:00 2002


On Thursday 04 April 2002  6:32 pm, you wrote:
> > hi all,
> > i'm probably just being thick but at the moment unable to figure the
> > following:
> > if i have a flypage with the code
> > [fly-list code="data session arg"]
> > [item-code]
> > [/fly-list]
> >
> > that works fine and then change it to
> > [fly-list code="data session arg"]
> > [item-code]
> > [include file="templates/mytemplate"]
> > [/fly-list]
> >
> > with mytemplate being something along the lines of
> > [item-code]<br />
> > [item-field description]
> >
> > why do the parameters not arrive/ are the tags left untouched?
> > or what would be even more interesting, how could i get the template to
> > play with the values that the including file has got access to?
> >
> > any pointers would be greatly appreciated as i am pretty lost on this
> > one.
>
> First, I'll assume that the "data session arg" was a typo and
> you know about the missing "[" and "]". :-)
>
> To answer your question, the [item-*] tags are "subtags" of the
> [fly-list] tag.  Once you get into your [include], you are
> inside a completely new tag and out of the reach of the subtag
> parser.
>
> You could do one of two things:
>
>     1) Move the [fly-list] tag into the included file.
>
>     2) Don't use [include].  Read the file into a variable in
>        catalog.cfg and use __MYTEMPLATE__ on the page instead.
>        (I think that'll work).  In catalog.cfg:
>
>            Variable MYTEMPLATE <templates/mytemplate
Cheers Kevin.
It was a typo indeed. 
I`ll try the the __MYTEMPLATE__ option and let you know about the results. 
Many thanks for the explanation though. Nice to get a somewhat clearer idea 
of the workings of interchange as the doc's seem to sort of scratch along the 
surface only.

Tim