eZ Community » Forums » Extensions » eZ Find » Filter by parent class_identifier
expandshrink

Filter by parent class_identifier

Filter by parent class_identifier

Wednesday 20 June 2012 12:27:30 pm - 3 replies

Hi developer,

is it possible to fetch all objects from subtree node with a parent class identifier filter?

I  want to get a sorted result of all classes X, if the parent of this is class Y and class X a direct child of this.

 

best regards,

scrieler

Thursday 21 June 2012 1:26:22 am

Would this approach work? Using YourClassX as the desired child class, and YourClassY as the parent class.
    {def $child_classes=fetch( 'content', 'list',
        hash(
            'parent_node_id', $node.id,
            'class_filter_type', 'include',
            'class_filter_array', array( 'YourClassX' ),
            'sort-by', array( 'priority', false() ) ) )}
    {foreach $child_classes as $child_class}
        {if $child_class.parent.class_name|eq('YourClassY')}
            {$child_class.name}
        {/if}
    {/foreach}

Good luck

Lara

Thursday 21 June 2012 8:38:38 am

no, I want to use a ezfind search without need to loop the result to get a final result...

currently I solved it with an extended attribute filter, but I want to know the possibility to use ezfind.

Modified on Thursday 21 June 2012 8:39:14 am by scrieler _

Thursday 21 June 2012 10:32:29 pm

Oh sorry - I should have paid more attention to the breadcrumbs.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from