[stringtemplate-interest] Separator definition

ilia at obnovlenie.ru ilia at obnovlenie.ru
Wed May 18 07:26:22 PDT 2005


I Keep on exploring StringTemplate in various web-related use cases.

Hopefully you'd excuse me for intensive questioning :)


Imagine I have to output a table with search results.
Every search result occupies a single row.

Rows are separated with a large construct like:
<tr>
	<td colspan=".." bgcolor=".. changing colors grey-white ..."> 
		....some design here .... 
	</td>
</tr>

In standard templates that's easy
{foreach results}
Result row
{if not last result}
Separator row
{/if}
{/foreach}

How do I code such thing in StringTemplate?
I can't even check whether an element is last in list.

Only the way I see is to point at another template in "separator"...
But such template must be declared separately from the main body, while it
should be inlined in fact, 
so that way will not do...

Any nice inlining solution ?








More information about the stringtemplate-interest mailing list