Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

order PageDataCollection per tree structure

Vote:
 

Hello y'all! Is there a way to order as per tree structure view a PageDataCollection in version 6 of episerver?

#148798
May 24, 2016 13:11
Vote:
 

Hi,

If your're using DataFactory.Instance.GetChildren(), they should already be sorted just like the page tree. Which method are you using to retrieve all pages?

I'm pretty sure there are no built-in sorting for this, so you have to iterate all pages and check their parent's sorting rule and then sort them manually with the same rule.

#148825
May 24, 2016 15:48
Vote:
 

Thanks Johan. I wasn't using GetChildren to get the collection of pages.

Apparently every PageData has a "PagePeerOrder" property retrievable by: PageDataItem["PagePeerOrder"]. I used that and it worked. It's the same index you see in the interface as you hover over a page item in the tree view.

Good evening!

#148835
May 24, 2016 17:35
Vote:
 

Hi again,

Glad you found a solution to your problem. But please notice that the PagePeerOrder property is only valid if the parent has set its children sort orde rule to sort by index. If an editor changes the sort order rule to e.g. 'Published date ascending' you can't use PagePeerOrder.

#148837
May 24, 2016 17:40
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.