[stringtemplate-interest] nesting templates and getting theloopcount of the outer loop
Roel Vanhout
rvanhout at riks.nl
Wed Oct 29 11:39:48 PDT 2008
>> I may be looking at this in a too code-like way, I don't know - but
is
>> there a way to do what I want?
> Sure. don't do group_nr = i0
> group_nr is visible anyway.
Well, I got it working, after much trial and error. I *do* need to do
group_nr=i0, but at a level higher: in the 'main' template. So for
anyone coming across this via Google, this template works:
group test;
inner() ::= <<
Page <group_nr>.<i0>
>>
outer(group_nr) ::= <<
Group <i0>
<it.Pages:inner();separator="\n">
>>
main(all_pagegroups) ::= <<
<all_pagegroups:outer(group_nr=i0);separator="\n">
>>
cheers,
roel
More information about the stringtemplate-interest
mailing list