Copied to clipboard

Flag this post as spam?

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


  • Kim Grandgagnage 63 posts 87 karma points
    Aug 05, 2011 @ 09:43
    Kim Grandgagnage
    0

    sortOrder unpublished nodes

    I have an XSLT macro, which loops through my nodes from the toplevel on, to create a horizontal dropdown menubar.

    In the for-each loop I sort on @sortOrder using:

     <xsl:sort select="@sortOrder" order="ascending" data-type="number" />


    The problem is that it does the sorting for published nodes, but not for unpublished nodes when I take a look in preview mode. The node appears then right after my home node in the menu bar...

    How is this possible?

  • Richard 146 posts 168 karma points
    Aug 05, 2011 @ 12:23
    Richard
    0

    Unpublished nodes do not appear in the data that your XSLT is running against. Have a look at the XML data file in data or App_Data folder (depending upon which version of Umbraco you are using).

    Why do you want to display unpublished content?

    Richard

  • Kim Grandgagnage 63 posts 87 karma points
    Aug 05, 2011 @ 12:43
    Kim Grandgagnage
    0

    Ah, I didn't know that. So there is no way that when a user previews a node, the sortorder is correctly applied... Tnx, it's clear now!

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 05, 2011 @ 13:15
    Chriztian Steinmeier
    0

    Hi Kim,

    It sounds a bit strange, though - it mighht have something to do with the way the preview works: When you press the preview button, Umbraco generates XML for the selected page and all of its descendants (to only create what's necessary) - so, in effect, you're getting mixed published and unpublished nodes in e.g. navigation (I'd think).

    You could try to just "Save" (not "Save and Publish") the document, then go to the root of the website and press the Preview button there (which will generate preview XML for all the nodes) and see if you're not getting the expected sorting.

    /Chriztian 

  • Kim Grandgagnage 63 posts 87 karma points
    Aug 05, 2011 @ 13:31
    Kim Grandgagnage
    0

    Chriztian,

    I tried what you suggested, but the nodes are also not correctly sorted when I press the Preview button on the root website node...

    grts,

    Kim

Please Sign in or register to post replies

Write your reply to:

Draft