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


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

May 24, 2016 13:11


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.

May 24, 2016 15:48

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!

May 24, 2016 17:35

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.

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.