This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » eZ Publish 5 Platform » eZ Demo Bundle : Edit Menu Sort Clause

eZ Demo Bundle : Edit Menu Sort Clause

eZ Demo Bundle : Edit Menu Sort Clause

Thursday 16 April 2015 2:35:39 pm - 4 replies


I use the exemple of the menu's eZMenuBundle to inspire me. I want to order element (and sub element) by priority.
So i edit this line :
I replace :

$query->sortClauses = array( new Query\SortClause\Location\Path() );


$query->sortClauses = array( new Query\SortClause\Location\Priority() );

But with this all the children's menu are in the same top line and i lost my
Is there a solution ?

Thursday 16 April 2015 5:04:58 pm

Hi Johann,

you can try combining Depth and Priority sort clauses, in that order. I think that might give you what you search for.



Friday 17 April 2015 1:58:00 pm

Like this ?

        $query->sortClauses = array( new Query\SortClause\Location\Path(),new Query\SortClause\Location\Priority() );

I have the same result sad.gif Emoticon

Friday 17 April 2015 1:58:39 pm

<del>Combine them using LogicalAnd you shall.</del>

Ignore that, was thinking Criteria and new Star Wars trailer happy.gif Emoticon It's an array here, just put Depth first.

Modified on Friday 17 April 2015 2:00:04 pm by André R

Friday 17 April 2015 3:32:21 pm

I took my lightsaber and i edit my code like this :

$query->sortClauses = array(new Query\SortClause\Location\Depth(), new Query\SortClause\Location\Priority() );

And it's ok master Yoda ^^
Thanks ! 


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

36 542 Users on board!

Forums menu

Proudly Developed with from