On 1/4/06, Liza <[EMAIL PROTECTED]> wrote:
> That produces:
>
> one | two | tree |
Bah, it does. I just did a straight translation of the code.
> When I had to do this, I wrote:
>
> <div py:strip="True" py:for="index, pagename in
> enumerate(['one','two','tree'])">
> <a href="${std.url('/%s' % pagename)}" py:content="pagename">Content</a>
> <span py:if="index + 1 < len(['one', 'two', 'tree'])"
> py:strip="True">|</span>
> </div>
>
> Is there an even shorter way?
Well if you know it's a list or tuple:
<?python pages = ['one','two','three'] ?>
<div py:strip="True" py:for="pagename in pages">
<a href="${std.url('/%s' % pagename)}" py:content="pagename">Content</a>ยท
<span class="separator" py:if="pagename != pages[-1]">|</span>
</div>
If it's an iterator, I'm not sure.