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

Reply via email to