attribute_filter

Author Message

Carlos Revillo

Wednesday 05 October 2005 4:59:08 am

hi. i want a list of folder. these folders are children of another one with node_id=60. but i'm trying to do a filter usin the id of the children nodes, but doesn't work for me. i'm using attribute_filter. something like this.

{let children=fetch( content, list, hash( parent_node_id, 90,
                                     sort_by, $node.sort_array,
attribute_filter, array(array('node_id','!=',90)),
                                     class_filter_type, include,
                                     class_filter_array, array( 'bloque'  ) ) )}

any ideas? thanks.

Kristian Hole

Friday 07 October 2005 8:54:15 am

Hi!

The attribute filter only works filtering on attributes of your classes. The attributes are here the values you enter for your classes in the class-definition in the administration interface. I am not entirely sure what you are trying to do. Can you try to explain?

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Carlos Revillo

Sunday 09 October 2005 1:28:08 am

sorry. let's see...
i have a folder wich node_id is, for example, 60.
i also have three sub-folders, node_id=61, node_id=62, node_id=63.

now i want a list of subfolders of folder with node_id=60 and i try...

{let children=fetch( content, list, hash( parent_node_id, 60,
                                     sort_by, $node.sort_array,
                                    class_filter_type, include,
                                     class_filter_array, array( 'folder'  ) ) )}

that works for me. but now i want an attribute_filter. i want a list of subfolders wich node_id IS NOT 62. so i try

{let children=fetch( content, list, hash( parent_node_id, 60,
                                     sort_by, $node.sort_array,
attribute_filter, array(array('node_id','!=',62)),
                                     class_filter_type, include,
                                     class_filter_array, array( 'folder'  ) ) )}

but i can't make it work. thanks.

Kristof Coomans

Sunday 09 October 2005 8:11:36 am

Filtering on node_id is currently not possible. But I think it wouldn't difficult to make this work. You can make an extended attribute filter, or you can patch the kernel.

In <i>kernel/classes/ezcontentobjecttreenode.php</i>, somewhere around line 913, there is:

switch ( $filterAttributeID )
{

After that, you can insert this code:

case 'node_id':
{
    $filterField = 'node_id';
}break;

I think that should do it (but I didn't tested it).

You can also program support for sorting on node_id in a similar way in the function createSortingSQLStrings.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Konrad Mazurkiewicz

Sunday 09 October 2005 2:12:33 pm

I think that you may filter fetch to folders only by class_filter, and next in loop, show only these nodes you're interested.
Konrad

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.