Forums / Setup & design / Question reguarding attribute_filter array

Question reguarding attribute_filter array

Author Message

Norman Leutner

Saturday 14 January 2006 12:03:47 pm

I need a simple list of nodes which belong to the current user and don't have the boolean attribute 'beendet' = true.

As far as I understand to following template code should match my needs:

{def $projekte=fetch( 'content', 'tree',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
                          attribute_filter, array( array('owner', '=', $user.contentobject_id),
                                                         array('beendet', '!=', true )),
                         'class_filter_type',  'include',
                         'class_filter_array', array( 'projekt' ) ) )}

I already took a look at http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/list
but can't get it working.

                          attribute_filter, array( 'and',
                                                         array('owner', '=', $user.contentobject_id),
                                                         array('beendet', '!=', true )
                                                       ),

also doesn't return the needed nodes.

A workaround for this would be to filter by myself:

{def $projekte=fetch( 'content', 'tree',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
                         attribute_filter, array( array('owner', '=', $user.contentobject_id) ),
                         'class_filter_type',  'include',
                         'class_filter_array', array( 'projekt') ) )
}

{foreach $projekte as $keyVar => $projekt sequence array('bglight', 'bgwhite') as $sequenceVar}

  {if ne($projekt.object.data_map.data_int, '1'}
    {$projekt.name|wash()}<br/>
  {/if}

{/foreach}

Has anyone a better solution to filter by boolean attributes?

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Saturday 14 January 2006 12:15:22 pm

Ok, I got it.

Just a small mistake:

                          attribute_filter, array( 'and',
                                                   array('owner', '=', $user.contentobject_id),
                                                   array(projekt/beendet', '!=', '1' )),

'projekt/beendet' did the trick...

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Sunday 15 January 2006 4:47:57 am

Ok at least the final result for further users:

                     attribute_filter, array( 'and',                                                    
                                                    array('owner', '=',  $user.contentobject_id),
                                                    array(projekt/beendet', '!=', true() )
                                                  ), 

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh