Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > tree.SelectNodes Orderby - return node by position in tree View modes: 
User avatar
Member
Member
john.banning-springbox - 10/9/2009 5:22:39 PM
   
tree.SelectNodes Orderby - return node by position in tree
All I would like to return document types in the order that they are listed in my tree view. I thought there would be an available field in the database that captured the position of the document in the tree, but I did not find anything.

Within a single folder called PressRelease I have a collection of "News" items. I only want to return the top 4 items as they appear in the tree regardless of the ID and Publish date. Is there someway I can write the code to handle this.

Current Code:
_listResults = tree.SelectNodes("foo", "/PressRelease/%", null, true, "foo.News", null, "NewsID DESC", 1, true);

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 10/11/2009 3:19:02 AM
   
RE:tree.SelectNodes Orderby - return node by position in tree
Hi,

If you would order by “NodeLevel, NodeOrder, NodeName” you will get the nodes/documents in the same order they are listed in your content tree.

Best regards,
Miroslav Remias.