Forums / Setup & design / problems combining class and attribute_filter in templates

problems combining class and attribute_filter in templates

Author Message

Christiane Kloss

Tuesday 10 May 2005 8:10:42 am

Dear eZ-crew,

I think I'll become mad today....

I'm using the following code:

{let redaktions_items=fetch( 'content','list',
							hash( 'parent_node_id', $node.node_id,
								'class_filter_type',  'include',
              					'class_filter_array', array( 'redakt_item' ),
              					'attribute_filter_array', array( 'and', array( 'redakt_item/status', '=', '1' ) ),
              					'sort_by', array( 'priority', false() ) ))
}

{section var=redakt_item loop=$redaktions_items}
 	{$redakt_item.name}:{$redakt_item.data_map.status.data_text}<br />
{/section}

Output:
--------
live/ on Tour:1
live/ on Screen:1
live/ on Air:1
live Kreuzfahrt:1
overview Termine:1
Galerie/ Unterwegs:1
<b>Booking:3</b>
Red/ Kartenservice:1

Why is Booking still there?

I'm using similar fetch (include only special class + attribute_filter) in other templates - and it is working fine.
Seperately it is working fine in this template:
include only redakt_items - all redakt_items appear,
attribute_filter on array( 'redakt_item/status', '=', '1' ) - Booking disappears, but of course the other classes will be displayed too...

status is an ezselection with single choice.

I'm using 3.5.2 (just upgraded from 3.5.1, hoping the problem might disappear...)
on Mac OX 10.3 with mysql 4.0.20

Any hints are very welcome....

Greetings Christiane

Marko Žmak

Tuesday 10 May 2005 4:59:30 pm

Try using 'attribute_filter' instead of 'attribute_filter_array' :) Se also:

http://www.ez.no/ez_publish/documentation/reference/data_fetching/content/list

for documentation about fetch.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Christiane Kloss

Wednesday 11 May 2005 1:15:18 am

Hi Marko,

I swear (!) I read the docu and the forum again and again....but didn't see what was wrong...

In German we say: "Wer lesen kann, ist klar im Vorteil." In English it means:"Someone, who can read, should take advantage of this"

Thank you very very much
I'm sure I will never forget this attribute_filter ;-)))

Christiane

Marko Žmak

Wednesday 11 May 2005 11:42:34 am

I'm also sure you won't forget it. :)

Something similar happened to me several times. The first thing to check when something doesn't work is if you written everything right - that saves a lot of time and work.

Also try using debug in eZ. Put this into your site.ini.append.php:

[DebugSettings]
DebugOutput=enabled

it helps a lot and can give you usefull warnings about errors in your code.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Christiane Kloss

Thursday 12 May 2005 4:07:15 am

Hi Marko,

debug was enabled, but unfortunatly no error or warning occurred.
At some point I was unable to relax - and in my mind this is one of the most important abilities when someone is dealing with eZ (easy)....;-)))

Greetings
Christiane

eZ debug

Timing: Jan 31 2025 01:15:27
Script start
Timing: Jan 31 2025 01:15:27
Module start 'content'
Timing: Jan 31 2025 01:15:27
Module end 'content'
Timing: Jan 31 2025 01:15:28
Script end

Main resources:

Total runtime0.2222 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 588.1875370.2578
Module start 'content' 0.00860.0255 958.44531,005.7500
Module end 'content' 0.03410.1881 1,964.19533,897.0859
Script end 0.2221  5,861.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00502.2529200.0003
Check MTime0.00170.7530200.0001
Mysql Total
Database connection0.00070.314610.0007
Mysqli_queries0.094142.33561410.0007
Looping result0.00130.60411390.0000
Template Total0.187584.410.1875
Template load0.00090.398710.0009
Template processing0.186683.974510.1866
Override
Cache load0.00060.281610.0006
Sytem overhead
Fetch class attribute can translate value0.00200.893710.0020
XML
Image XML parsing0.00030.126010.0003
General
dbfile0.023310.4928200.0012
String conversion0.00000.001830.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