Forums / General / attribute_filter

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

eZ debug

Timing: Jan 18 2025 10:42:29
Script start
Timing: Jan 18 2025 10:42:29
Module start 'content'
Timing: Jan 18 2025 10:42:30
Module end 'content'
Timing: Jan 18 2025 10:42:30
Script end

Main resources:

Total runtime1.2440 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.7109180.8516
Module start 'content' 0.00720.9991 769.5625642.5234
Module end 'content' 1.00630.2376 1,412.0859337.0859
Script end 1.2439  1,749.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3213210.0002
Check MTime0.00150.1197210.0001
Mysql Total
Database connection0.00110.092210.0011
Mysqli_queries1.158193.09632040.0057
Looping result0.00270.21582020.0000
Template Total1.204796.820.6023
Template load0.00220.176320.0011
Template processing1.202596.661420.6012
Template load and register function0.00030.020910.0003
states
state_id_array0.00160.125210.0016
state_identifier_array0.00220.173020.0011
Override
Cache load0.00190.1495310.0001
Sytem overhead
Fetch class attribute can translate value0.00160.128250.0003
Fetch class attribute name0.00110.086070.0002
XML
Image XML parsing0.00160.128550.0003
class_abstraction
Instantiating content class attribute0.00000.001170.0000
General
dbfile0.00260.2057330.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs