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...
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).
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.
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?
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
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!
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
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
is working on a reply...