On 7.2.2011 16:45, Clinton Gormley wrote:
> On Mon, 2011-02-07 at 15:22 +0100, Jiří Pavlovský wrote:
>> Hi,
>>
>> I Have a block like below. It will produce the following output when
>> included with the 'collapse' filter.:
>>
>> "- name1 , name2 , and name 3 en".
> [%
> # non-destructive copy
> # drop .merge if you don't care if it is destructive
> authors = COLUMN.list_authors.merge;
>
> first = authors.pop;
> IF authors.size> 1;
> authors.join(', '); ', and ';
> ELSIF authors.size == 1;
> authors.shift; ' and ';
> END;
> first;
> %]
Thanks, nice solution
> Note: In English, we don't use "a, b, and c", but "a, b and c", which
> would make the above:
I'm supposed to do it the way above.
Regards.
Jiri
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates