[stringtemplate-interest] Conditional attribute placement

Mike Evans mike.evans at rapid-mobile.com
Thu Jul 31 02:05:15 PDT 2008


Hi

I'm trying to conditionally place items of a collection of attributes on 
a page, using stringtemplate expression syntax.  I need to iterate 
through (for example) a list of 7 attributes, and place 4 on one line, 
then place a line break and place three on the next line.  Is there a 
way I can do this using expression syntax, or some other method?  I see 
there is are ways to differentiate between first and last items in a 
list, but how can I tell if it's the third or fourth item, and insert a 
line-break conditional on being the 4th item?

I don't want to have to create two attribute lists and output them 
individually with a line break in between, which would be a way to do 
it, but appears to break the strict model-view separation; the attribute 
lists are generated in the model, and the arrangement on the page 
defined by the view.

many thanks
Mike
-- 
Mike Evans
Rapid Mobile Ltd.
93 George St. Edinburgh EH2 3ES
Tel: +44 131 243 2502



More information about the stringtemplate-interest mailing list