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