Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > ORDER BY document tree for multiple documents type View modes: 
User avatar
Member
Member
jacques.honore-gmail - 4/18/2012 10:47:35 AM
   
ORDER BY document tree for multiple documents type
Hello,

New to kentico my purpose is to be able to list all blog posts and events within a specific folder.

I got the path configuration correct and the document type also. I am only struggling on the "ORDER BY expression".

I can't find the way to order the documents as they are ordered in the document tree.

Any help or link to reference would be appreciated.

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/18/2012 11:08:38 AM
   
RE:ORDER BY document tree for multiple documents type
Hello,

The order by value you are looking for is NodeOrder:

Order By: NodeOrder


Best regards,
Jan Hermann

User avatar
Member
Member
jacques.honore-gmail - 4/18/2012 12:28:40 PM
   
RE:ORDER BY document tree for multiple documents type
Super it works!

Thanks,
Jacques

User avatar
Member
Member
jacques.honore-gmail - 4/18/2012 12:33:02 PM
   
RE:ORDER BY document tree for multiple documents type
In fact it is not working at its best.

The content is sorted in the order they are in the tree, but since I list both blog post and events I end up with first the events and then the blog post.

Is there a way for events and blog posts to be mixed within the same list but still being sorted as they are in the document tree?

Jacques

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/18/2012 1:10:19 PM
   
RE:ORDER BY document tree for multiple documents type
Hello,

If they are on the same level under the same location (folder) in the document tree, then the NodeOrder order by property lists them as they are in the document tree. If you want to have them sorted by NodeOrder but to separate them into two different groups, then use following oreder by property:

Order by: ClassName, NodeOrder


Best regards,
Jan Hermann

User avatar
Member
Member
jacques.honore-gmail - 4/19/2012 4:04:55 AM
   
RE:ORDER BY document tree for multiple documents type
Thanks for your support. I can get the order to change, but it is not working nicely because they are not under the same folder.

My structure is as below:

Blog
--Month A
----Event 1
----Blog Post 1
----Event 2
--Month B
----Event 3
----Blog Post 3

So I guess I need to add one sorting criteria before the NodeOrder which should be the "MonthFolder".

Do you know the value which would work? It could be something like ParentNodeID or something equivalent?

Thanks for your help!
Jacques

User avatar
Member
Member
jacques.honore-gmail - 4/19/2012 4:06:39 AM
   
RE:ORDER BY document tree for multiple documents type
In fact what I need is to use SORT BY: ParentNodeOrder, NodeOrder

I am not sure if the ParentNodeOrder is available?

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/19/2012 4:50:12 AM
   
RE:ORDER BY document tree for multiple documents type
Hello,

Oh, I've got it. In this case please use following order by expression:

Order by: NodeParentID DESC, NodeOrder


Best regards,
Jan Hermann

User avatar
Member
Member
jacques.honore-gmail - 4/19/2012 5:24:32 AM
   
RE:ORDER BY document tree for multiple documents type
Thanks it works now!

Great support!
Jacques

User avatar
Certified Developer v7
Certified  Developer v7
timur-r42 - 4/25/2012 2:36:57 PM
   
RE:ORDER BY document tree for multiple documents type
Hello

I use nested repeater to show products.
My structure is:

Products
prodGroup1 (ID=21)
-A1
-A2
-A3
prodGroup2 (ID=20)
-B1
...
prodGroup3 (ID=23)
-C1
...

I tried to sort them by: NodeParentID, NodeOrder.

But my problem is IDs, so in this case i can't sort by ParentID

Is there other way to do it?

Thank you,

Timur

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/26/2012 1:01:06 AM
   
RE:ORDER BY document tree for multiple documents type
Hello Timur,

Could you please try to sort it by following Order by condition:

NodeLevel, NodeOrder, NodeName


Best regards,
Jan Hermann

User avatar
Certified Developer v7
Certified  Developer v7
timur-r42 - 4/26/2012 8:53:57 AM
   
RE:ORDER BY document tree for multiple documents type
Hello Jan,

I can't use NodeName.
Sorry for wrong example
This one is better explains my problem:

CARS (menu item)
•Toyota (menu item)(ID21)
-Rav4 (product)
-Corolla (product)
-Yaris (product)
•Honda (menu item)(ID20)
-Pilot (product)
-Civic (product)
-Accord (product)
•Nissan (menu item)(ID23)
-Rogue (product)
-Murano (product)
-Altima (product)

In the repeater i use "/CARS/%" path and "Document types: : product"
I want to show the list of cars sorted by NodeOrder.
Like this:
-Rav4
-Corolla
-Yaris
-Pilot
-Civic
-Accord
-Rogue
-Murano
-Altima

NodeOrder doesn't work correct

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/27/2012 1:32:59 AM
   
RE:ORDER BY document tree for multiple documents type
Hello,

Even products are documents, so following order by property should work:

NodeLevel, NodeOrder


What output do you get when you set the order by property above?

Best regards,
Jan Hermann