This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Per-language content ordering
expandshrink

Per-language content ordering

Per-language content ordering

Monday 13 August 2012 1:14:52 pm - 3 replies

This isn't possible, right?  Ordering of sub-items happens at the node level, and language at the contentobject level, and never the two shall meet.

A work-around would be to replicate the ordering in each container content class, and feed this to the fetch functions for sorting.

Any other ideas or thoughts?

Tuesday 14 August 2012 11:44:00 am

You can use a translatable attribute in your child content class to set a priority. The attribute can than be used in your fetch function (e.g. content list) for the sort_by parameter. But in my opinion, the container content class approach would be superior to this one because of its centralized and easier to change manner.

However, i think there is an other approach for navigation ordering (based on translation), by using the node tree in a more abstract way and not for building your navigation or ordering content for the frontend siteaccess. Example node tree structure:

+ Folder-Level-1
    + Folder-Level-2
        + Pageframe
        + Content Collector
        + Article
        + Navigation
    + Pageframe
    + Content Collector
    + Article
    + Navigation 

Explanation: Every page is represented by a folder. The content is rendered by the Pageframe object and the navigation is rendered by the Navigation object. Each Folder object has an attribute object relation to a Pageframe object, each Pageframe object has an attribute object relation to a Navigation object and each Navigation object has an attribute object relation list to its child nodes (e.g. from Folder-Level-1>Navigation to Folder-Level-2>Navigation) which can be translated and sorted. This approach gives you an insane amount of flexibility (for building your navigation and content, e.g. landingpages, columned content ..) but can be quite complex to handle for your content editors.

Tuesday 14 August 2012 12:53:16 pm

Thanks Daniel!  Yep, the abstract model would be replicating the Drupal/Joomla menu systems somewhat, and though it's great for devs, it's, as you say, hard work for administrators/editors to follow.

Perhaps storing the info in a join table would work, pulling in the language, sort array and priority together; and set in the Admin UI by clicking on the Translations tab, clicking on the translation you want to change ordering for, then on the Ordering tab (as works currently with the View tab), and display the priority settings for children based on the main language, but changeable on per language basis.

Wednesday 15 August 2012 9:21:18 am

Quote from Geoff Bentley :

Thanks Daniel!  Yep, the abstract model would be replicating the Drupal/Joomla menu systems somewhat, and though it's great for devs, it's, as you say, hard work for administrators/editors to follow.

Perhaps storing the info in a join table would work, pulling in the language, sort array and priority together; and set in the Admin UI by clicking on the Translations tab, clicking on the translation you want to change ordering for, then on the Ordering tab (as works currently with the View tab), and display the priority settings for children based on the main language, but changeable on per language basis.

 

If you do it this way, then it should be straight-forward to create a custom fetch using ezpersistentobject::fetchobjectlist and join on your sorting tables

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from