4 users online. Create an account or sign in to join them.Users

Search

A new XSLT utility, "group by position" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

@Cremol, Nice utility. Couple of questions though, the utility is currently not valid...

<xsl:apply-templates select="entry[position() mod 4 = 1]" mode="group" />

The <xsl:apply-templates/> element has to be a child of a <xsl:template/> element.

Also, the name "group items" might confuse users who are looking to group by category or something like that. Isn't this more of a "group by position" utility? Just a thought.

Thanks for your creativity and sharing this utility with us.

@bzerangue
Oops.. forgot about that... I changed it now
I find it pretty hard to describe the essence of this utility in a couple of catchy words
Group items just sounds good, but indeed might cause some confusion
I will change it 'group by position' unless someone has a better name?...

Since the name of this utility is 'group items' (for now)
I was wondering if it's possible to group items by a certain value in the entry
I am looking for something like this:

<xsl:apply-templates select="entry[category/item/@handle ='category-a']" />

This would apply the template only to the entries with a fieldname 'category' with a value of 'category-a'
It's not working at the moment, but i feel like i am pretty close... or not?

EDIT: I managed to get to the desired result by grouping the datasource by this field
But if anyone could come up with a pure xslt solution would be nice.. maybe i could implement it in this utility

@Cremol, the pure XSLT 1.0 solution would be to use the Muenchian Method.

Or you might also want to see this Grouping Page from Jeni Tennison.

Thanks, very usefull pages
I used the Muenchian Method before, and it's quit a different approach then what i was looking for in my example, which would have suited well with the 'group item by position' method
So therefore this utility will now be called 'group by position' :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details