1 users online. Create an account or sign in to join them.Users
Sort on Sort?
This is an open discussion with 12 replies, filed under General.
Search
You could just add one sort after the other:
<xsl:for-each select="*">
<xsl:sort select="points" order="descending" />
<xsl:sort select="legs" order="descending" />
<xsl:do-stuff-here />
</xsl:for-each>
Try XSLT. :-)
<xsl:sort select="points" data-type="number" order="ascending"/> <xsl:sort select="legs" data-type="number" order="ascending"/>
Should work fine.
Nils is too fast for me. Plus, he sorted descending. 2 points for him.
Hey, Michael, you got the right data-type. Let’s say 1:1 :)
P.S.: Maybe we should introduce a XSLT tennis championship (although I think Allen will always win).
Allen will act as umpire. I would never want to play XSLT against him. :-)
That simple?
Great.
So Could I use this xsl:sort in a <a href link> to sort my entires in order of salary or Company name etc? plus use a session monster to alter the order from ascending or decending depending on what was clicked last time?
This would be the answer I’m looking for if it can be used on a links..
Theoretically, yes, but only if ALL entries are being returned at once. And you’d have to use parameters, either URL params or GET params… Wouldn’t be the cleanest solution. Would probably be much easier to tweak the DS.
This is what I’m trying to do in this thread: http://www.symphony-cms.com/community/discussions/32122/
But anything other than system:id or system:date throws no results on 2 of the three url parameters..
i.e www.domain.co.uk/jobs/ displays and sorts as expected
but www.domain.co.uk/jobs/part-time www.domain.co.uk/jobs/full-time displays no results when I use {$url-s:salary-from} as the dsParamSORT any ideas?
Please don’t double-post moonoo2, your other thread is sufficient to have this question answered. This thread is about strategies for sorting in XSLT.
got it.. wasnt aware of the sorting via xslt so weighing up the pros and cons of DS sorting as czheng mentioned.
Create an account or sign in to comment.
Is it possible?
For example I have a league table that is sorted via points, but if the team is level on points it would then need to be sorted via legs.
I did a quick Google search and couldn’t find anything suitable.