Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Crowe 192 posts 256 karma points
    Nov 09, 2010 @ 15:08
    Phil Crowe
    0

    change order in foreach loop

    i have a foreach loop that lists some nodes and theyre properties. each item in the list is displayed in a div, all of these divs have a float left making them sit next to each other from left to right on the page. Just wondering is it possible to move an item to the front of this list(far left) if, for example it has a true/false datatype property that is set to true?

  • Powellze 38 posts 73 karma points
    Nov 09, 2010 @ 15:43
    Powellze
    0

    This might be what you mean?

    <xsl:for-each select="$currentPage/* [not(umbracoNaviHide = 1)]">
    <xsl:sort select="myCustomVariable" order="descending" />

     

    Replace myCustomVariable with any variable that is set for that section, I have used the for-each to show where you would put the sort.

    I reckon if you used a true/false you could still use Asc/desc?

Please Sign in or register to post replies

Write your reply to:

Draft