[ic] conditional surrounded reparse breaks

Mike Heins mike at perusion.com
Thu Nov 4 12:34:13 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]

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.328.4479  <mike at perusion.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer




More information about the interchange-users mailing list