[ic] Included file in flypage.html not parsing

Ed LaFrance (New Media E.M.S.) ic_users at newmediaems.com
Wed Jul 7 11:26:38 EDT 2004


At 07:53 PM 7/6/2004, you wrote:


> > -----Original Message-----
> > From: interchange-users-bounces at icdevgroup.org
> > [mailto:interchange-users-bounces at icdevgroup.org]On Behalf Of the OnE
> > Sent: Tuesday, July 06, 2004 9:01 PM
> > To: interchange-users at icdevgroup.org
> > Subject: [ic] Included file in flypage.html not parsing
> >
> >
> >
> >
> > I'm trying to slice the code within my flypage.html
> > and just use [include file] to make part of the code
> > available when needed.. Is this solution optimal or
> > not
> > ? Any other? Another problem with this style of coding
> > is....  [item-code] tags within the included file are
> > not parsed ... they are printed as is ( plain tag )
> >
> > File: flypage.html
> > --------------------
> >  [if cgi ostep eq "1"]
> >
> >      [include pages/fp-step-1 interpolate=1]
> >
> >  [elsif cgi ostep eq "2"]
> >
> >      [include pages/fp-step-2 interpolate=1]
> >
> >  [/elsif]
> >  [/if]
> >
> >
> > File: fp-step-1
> > -------------------------------
> > Step 1
> > <br>
> > item code: [item-code]
> >
> >
> > File: fp-step-2
> > -------------------------------
> > Step 2
> > <br>
> > item code: [item-code]
> >
>
>from what i've seen, the [PREFIX-tags] are parsed before the other tags in
>the loop are (presumably so that tags like [page [item-code]] will work).
>At the time that the [item-code] tag would be parsed, the [include] hasn't
>happened yet...so the contents of the included file wouldn't be checked for
>an [item-code].
>
>One workaround would be to set a scratch variable and use it instead, like
>so...
>
>[tmp item][item-code][/tmp]
>[if cgi ostep eq "1"]
>  [include pages/fp-step-1]
>[elsif cgi ostep eq "2"]
>  [include pages/fp-step-2]
>[/elsif]
>[/if]
>(the include tag interpolates by default; interpolate=1 probably isn't
>needed.)
>
>the two included pages could then use [scratch item] instead of [item-code].

You are correct about interpolation order, so that is one way to tackle 
this. Another way is to define the code snippets as catalog variables, 
which are interpolated before [prefix-*] tags:

## In catalog.cfg, or in a separate file include'd into catalog.cfg

Variable FP_STEP_1 <<EOV
         ...(body of fp-step-1)
EOV

Variable FP_STEP_2 <<EOV
         ...(body of fp-step-1)
EOV

Then you can do:

[if cgi ostep eq "1"]
         __FP_STEP_1__
[elsif cgi ostep eq "2"]
         __FP_STEP_2__
[/elsif]
[/if]

...and it will work the way you want.

- Ed

===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          Ed.LaFrance at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
=============================================================== 



More information about the interchange-users mailing list