[ic] conditional surrounded reparse breaks

Paul Jordan paul at gishnetwork.com
Thu Nov 4 15:51:04 UTC 2010


> Quoting Mike Heins (mike at perusion.com):
> > Quoting Paul Jordan (paul at gishnetwork.com):
> > > 
> > > 
> > >    I have a situation where I conditionally serve page content, alternatively
> > >    serving and different page via an [include]. I realize I can use a bounce,
> > >    but I do this in this particular page so the page name stays the same and
> > >    the user is unaware they are not seeing what they are supposed to be seeing.
> > >    Donât comment on the âwhat?â, itâs a very odd situation with a third party
> > >    that I have very limited access to. Simplified:
> > > 
> > >    [tmp foo][/tmp]
> > > 
> > >    [if scratch foo]
> > >        [include pages/existingpage.html]
> > >    [else]
> > > 
> > >        regular page content
> > >        [strip reparse=0]
> > >            <!--[if IE]>
> > >                test 1
> > >            <![endif]-->
> > >        [/strip]
> > > 
> > >    [/else]
> > >    [/if]
> > 
> > Why not 
> > 
> > 
> >    [if scratch foo]
> >        [include pages/existingpage.html]
> >    [else]
> >        [include pages/otherpage.html]
> >    [/else]
> >    [/if]
> > 
> > ??
> > 
> > Alternatively you could do:
> > 
> >    [if scratch foo]
> >        [include pages/existingpage.html]
> >    [else]
> >        [tmpn t_content]
> >    regular page content
> >    [strip reparse=0]
> >        <!--[if IE]>
> >    test 1
> >        <![endif]-->
> >    [/strip]
> > [/tmpn]
> > [scratchd t_content]
> >    [/else]
> >    [/if]
> 
> And I was wondering about the premise. Actually, the bug is in the
> finding of the [/if], and the second possibility doesn't work. And it
> is definitely a bug, if one I don't have a general solution for.
> 
> This works:
> 
>    [tmpn IE][if IE][/tmp]
>  
>    [if scratch foo]
>        [include pages/existingpage.html]
>    [else]
>  
>        regular page content
>        [strip reparse=0]
>            <!--[scratch IE]>
>                test 1
>            <![endif]-->
>        [/strip]
>  
>    [/else]
>    [/if]


Thanks Mike and Peter
I went with Peter’s suggestion because I couldn’t get yours to work (initially) Mike. Afterward I played with yours and I believe you meant to leave out the [strip] tags, once I remove those it worked as expected. That makes yours and Peter’s suggestion very similar, but with yours you can take advantage of any processing you can do anywhere in the page more easily. I’m not doing any more processing in this block but thought I’d mention it for the archives. 
Work around #1
-----------------------------
[tmpn IE]
     <!--[scratch IE]>
          test 1
     <![endif]-->

[/tmpn]
  
[if scratch foo]
        [include pages/existingpage.html]
[else]
        regular page content
        [scratch IE]
[/else]
[/if]


Work around #2
-----------------------------
[tmpn IE][if IE][/tmpn]
  
[if scratch foo]
      [include pages/existingpage.html]
[else]
        regular page content
            <!--[scratch IE]>
                test 1
                .... and other ITL processing...
            <![endif]-->
[/else]
[/if]


Thank you again
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.icdevgroup.org/pipermail/interchange-users/attachments/20101104/d0319b12/attachment.htm>


More information about the interchange-users mailing list