I think it should allow a "group" or "size" option.

<r:if_first size="3"> would apply to the first 3. Working with more than just one would be useful.

I would want to have these tags with that option:
if_first / unless_first
if_last / unless_last

I'm not sure about the name of the parameter though. Perhaps <r:if_first window="3">

On Jun 26, 2008, at 8:27 AM, Simon Josi wrote:

The tag r:children could provide two more tags that can be used to
determine with which element we are working with in each iteration.

This example implements the functionality with currently available tags:
<ul class="blog_entries">
 <r:find url="/blog">
   <r:children:each limit="1">
     <li class="first"><r:snippet name="blogentry_preview"/></li>
   </r:children:each>
   <r:children:each order="asc" limit="5" offset="1">
     <li><r:snippet name="blogentry_preview"/></li>
   </r:children:each>
   <r:children:each order="asc" limit="1" offset="4">
     <li class="last"><r:snippet name="blogentry_preview"/></li>
   </r:children:each>
 </r:find>
</ul>

I need to assign the class "first" to the first element and the class
"last" to the last element.

It would be nice to make it work like that:
<ul class="blog_entries">
 <r:find url="/newsblog">
   <r:children:each limit="7">
     <li class="<r:snippet name="blogentry_preview_class"/>">
       <r:snippet name="blogentry_preview"/>
     </li>
   </r:children:each>
 </r:find>
</ul>

The snippet blogentry_preview_class would look like this:
<r:children:if_first> first </r:children:if_first>
<r:children:if_last> last </r:children:if_last>

Would anyone else would want to have these tags available?

cheers
/simon
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to