Forums / Setup & design / Fetch only object with a selection-attribute specified?

Fetch only object with a selection-attribute specified?

Author Message

Daniele Nocentini

Wednesday 31 May 2006 6:49:36 am

Hi

I have a class with a three selection attributes. I want to fetch only nodes with that selection contain specific string. This would be my guess, but I'm not able to get it work:

{def $list_items=fetch( 'content', 'list', hash( 'parent_node_id', 138,
			  
              'class_filter_type',  'include',
              'class_filter_array', array(38),
			  'attribute_filter', array( 'and', array( 299, '=', 'Commerciale' ), array( 300, '=', 'Moto' ) ),
			   ) )}

Antica Bottega Digitale srl
http://www.abd.it

Marcin Drozd

Wednesday 31 May 2006 7:38:43 am

Hi Daniele
try with

{def $list_items=fetch( 'content', 'list', hash( 'parent_node_id', 138,
             'class_filter_type', 'include',
             'class_filter_array', array(38),
                         'attribute_filter', array( 'and', array( 299, '=', 'Commerciale' ), array( 300, '=', 'Moto' ) )
                          ) )}

without "," after 'Moto' ) ) :)

http://ez-publish.pl

Daniele Nocentini

Wednesday 31 May 2006 12:37:29 pm

The question is, can attribute_filter works with selection datatype (with multiple selection choice)?

Antica Bottega Digitale srl
http://www.abd.it

Marcin Drozd

Wednesday 31 May 2006 2:48:08 pm

Hi, I got it wrong, sorry

can attribute_filter works with selection datatype?

Yes, it is possible, but U should use:

'attribute_filter', array( array( 299, '=', VALUE ) )

where VALUE starts from 0.
(with selection datatype (with single choice, I never tested with multiple) options have value from 0)

ex. for

<select name="aaa">
<option value="0">Commerciale 1</option>
<option value="1">Commerciale 2</option>
<option value="2">Commerciale</option>
</select>

use:

(for string 'Commerciale') 'attribute_filter', array( array( 299, '=', 2 ) ) or better
'attribute_filter', array( array( 299, '=', ezhttp( 'aaa', 'post' ) ) )

http://ez-publish.pl

eZ debug

Timing: Jan 19 2025 01:09:28
Script start
Timing: Jan 19 2025 01:09:28
Module start 'content'
Timing: Jan 19 2025 01:09:28
Module end 'content'
Timing: Jan 19 2025 01:09:28
Script end

Main resources:

Total runtime0.2716 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0099 590.3281180.8125
Module start 'content' 0.00990.0141 771.140698.0703
Module end 'content' 0.02400.2475 869.2109526.3750
Script end 0.2715  1,395.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.3010200.0002
Check MTime0.00140.5269200.0001
Mysql Total
Database connection0.00110.407910.0011
Mysqli_queries0.204475.25931410.0014
Looping result0.00170.62321390.0000
Template Total0.247090.910.2470
Template load0.00110.391310.0011
Template processing0.245990.551810.2459
Override
Cache load0.00080.278410.0008
Sytem overhead
Fetch class attribute can translate value0.00070.273610.0007
XML
Image XML parsing0.00020.082810.0002
General
dbfile0.00943.4630200.0005
String conversion0.00000.002530.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs