I'm not sure this would gain him much.  He'd still need to know how to
figure out if the list item is the last one in the iteration.  Of course, it
would address his whitespace problem.

I think what Chris wants is something that I've been advocating for for a
little while now.  That's something quite similar to the for "component" of
Django:

http://www.djangoproject.com/documentation/templates/#for

With the introduction of the "var" prefix, the above could be approximated
by the addition of two new component parameters: {first, last}.  Each could
be bound to a boolean and with the "var" prefix that could be accomplished
without any additional Java code.  The value could then be used in an If
component in order to perform the proper rendering.

-- 
Kevin


On 1/13/08 8:47 PM, in article [EMAIL PROTECTED],
"Jonathan Barker" <[EMAIL PROTECTED]> wrote:

> Chris,
> 
> This is a job for CSS.
> 
> You are creating a list, so render your links in an unordered list, and set
> the class attribute for the last item to "last" and then use a CSS recipe
> for creating inline lists:
> 
> ul,li {
>    display:inline;
>    margin: 0;
>    padding 0;
> }
>    li:after {
>    content: ", ";
> }
> li.last:after {
>    content: ".";
> }
> 
> You may need to set any surrounding paragraphs to display inline as well if
> you want the list included in the text flow.
> 
> Jonathan
> 
> 
>> -----Original Message-----
>> From: Chris Lewis [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, January 12, 2008 5:05 PM
>> To: users@tapestry.apache.org
>> Subject: T5: 5.0.8 whitespace
>> 
>> So this ticket has been implemented in svn:
>> https://issues.apache.org/jira/browse/TAPESTRY-2028
>> 
>> And now I need whitespace... so how can I get it back? Is there or isn't
>> there a way to disable this? Im using loop to output links (pagelinks),
>> and i have whitespace behind in the body so there is separation.
>> Unfortunately, it's getting stripped. Is there a workaround?
>> 
>> On a related note, is there a way to know if im on the last iteration of
>> the loop, so i could for example, follow all but the last with a ","?
>> This may be outside the scope of loop as currently implemented, but i
>> can see it being useful.
>> 
>> chris
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to