[ic] improving awkward IF syntax

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Thu Dec 20 16:10:01 2001


On Thu, Dec 20, 2001 at 12:33:31PM -0800, Bob Ramstad wrote:
> Second question.  
> 
> (Again, I'm a digester, so if you send a response to the list and to
> me directly, I'll be able to get this fixed faster.  Thanks in advance
> for CCing me directly.  Yow.)
> 
> One of my goals is to make it so that all the content lives in the
> database and is being served from flypage.html.  That's the way we've
> got it architected on another system, and we'd like to keep it that
> way.
> 
> I've added products::type and products::orderable as columns to the
> products database.  type can be PAGE, ITEM or NIL.  orderable can be
> YES or NO.  Using combinations of these settings, I can determine
> exactly how to display the page.


You might be able to skip a lot of the logic if you use 
PageSelectField.  Have you looked at that?

It's next to impossible for someone to guess what is going
to be easier for someone else.  :-)  YMMV.



> 
> This setup has been working fairly well, but one thing that is
> bothering me is that I have to use some rather awkward constructions
> in flypage.html for testing these values, like this:
> 
> [if explicit][condition]return [item-field type] eq 'ITEM';[/condition]
> <<code>>
> [/if]
> 
> For whatever reason, all the more obvious bits of simpler syntax do
> not work.  I end up in the ELSE clause when I'm not supposed to, or
> the code is skipped over... indicating that the test didn't match.
> 
> I've tried a variety of constructions, with and without quoting the
> argument, e.g.
> 
> [if-item-field type eq 'ITEM']
> 
> doesn't work.
> 
> I'm concerned that this convoluted syntax may lead to performance
> issues down the road.  So, a couple of (obvious) questions:
> 
> 1) Is there a better and simpler ITL syntax which will work?
> 
> 2) If not, is there a simplification or modification of my database
>    structure which will allow better and simpler ITL syntax?
> 
> 3) Finally, I see references in the documentation to the fact that IF
>    is slow, and complicated tests should be done in Perl for
>    performance reasons.  Can someone give me an example of how to do
>    the test above in Perl?
> 
> Thanks in advance for your help!
> 
> -- Bob
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                               cfm@maine.com
MaineStreet Communications, Inc           208 Portland Road, Gray, ME  04039
1.207.657.5078                                         http://www.maine.com/
Content/site management, online commerce, internet integration, Debian linux