Disabling Sorting of Translated Pages on the Site Tree


I am looking for a way to disable content editors from sorting / re-ordering pages that have been translated into other languages. I have looked into DataFactory.PageSaving event, but seems like it fires for the current page that you are change the sort order as well as for pages underneath it.

Sep 30, 2014 12:10

So there are two properties involded here. First "PageChildOrderRule" (or ChildSortOrderRule) that controls the default sort order of the children of a page, then "PagePeerOrder" (or SortIndex) that is the number used to sort the siblings. ChildSortOrderRule of the parent page must have the value FilterSortOrder.Index otherwise manual sorting using the SortIndex property of the children has no effect.

The first time when you drag and drop a page in the page tree under the same parent page it will ensure that the parent page has FilterSortOrder.Index and apply an initial value for SortIndex on all child pages. You can see the code for this in the method PageSorterHelper.ChangeSortRuleToIndexMaintainOrder()

Unfortunatly EPiServer is not using Inversion of Control for PageSortHelper or ContentStructureStore so it will be hard to override the default behavior.

The only stategy I can see as a solution is the one you have started by adding a hander for SavingContent using IContentEvents (or DataFactory). If you detect that these properties are changed, throw an AccessDeniedException instead of setting Cancel to false. This will abort the reordering and show a nice error in the user interface.

Oct 04, 2014 0:54
* 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.