Niko Goers
|
Tuesday 30 October 2007 8:38:43 am
Hello Community, I have one question regarding the "attribute_filter" in a simple fetch and I suspect that the fetch-documentation couldn't help me anymore. ( http://ez.no/doc/ez_publish/technical_manual/3_10/reference/modules/content/fetch_functions/list ) I want to fetch objects, which are similar to the current object. <b>And it works fine:</b> {def $aehnliche_themen = fetch( 'content', 'tree',
hash( 'parent_node_id', 2,
'attribute_filter', array( 'or',
array( 'name', 'like', $aehnliche_themen_like_1 ),
array( 'name', 'like', $aehnliche_themen_like_2 ),
array( 'name', 'like', $aehnliche_themen_like_3 ),
array( 'name', 'like', $aehnliche_themen_like_4 )
),
'sort_by', array( 'published', false() ),
'limit', 5
)
)
}
<b>Now I want to exclude the current object from the fetch result, but then it doesn't work anymore:</b> {def $aehnliche_themen = fetch( 'content', 'tree',
hash( 'parent_node_id', 2,
'attribute_filter', array( 'and',
array( 'or',
array( 'name', 'like', $aehnliche_themen_like_1 ),
array( 'name', 'like', $aehnliche_themen_like_2 ),
array( 'name', 'like', $aehnliche_themen_like_3 ),
array( 'name', 'like', $aehnliche_themen_like_4 ) ),
array( array( 'name', '!=', $node.name ) ) ),
'sort_by', array( 'published', false() ),
'limit', 5
)
)
}
Is it possible to do it in that way? And where are my mistakes? Thanks for any suggestions.
eZ Publish partner - http://www.all2e.com
http://share.ez.no/directory/companies/all2e-gmbh
http://ez.no/Partners/all2e-GmbH
Lords of Heaven - http://www.LoH-Gilde.de (Created with eZ Publish)
German online gaming guild
About me - http://www.NikoGoers.de
My roadmap, +1 are welcome: http://share.ez.no/community/roadmap/10889
|
Niko Goers
|
Tuesday 30 October 2007 9:04:46 am
Hi Heath, Thank you for the quick answer, but I don't found there an answer of my question regarding the current node exclusion. My "attribute_filter" without the name exclusion works fine. [...]
'attribute_filter', array( 'and',
array( 'or',
array( 'name', 'like', $aehnliche_themen_like_1 ),
array( 'name', 'like', $aehnliche_themen_like_2 ),
array( 'name', 'like', $aehnliche_themen_like_3 ),
array( 'name', 'like', $aehnliche_themen_like_4 ) ),
array( array( 'name', '!=', $node.name ) ) ),
[...]
The combination of the two arrays in the "attribute_filter" doesn't work. Without each other both arrays are working.
eZ Publish partner - http://www.all2e.com
http://share.ez.no/directory/companies/all2e-gmbh
http://ez.no/Partners/all2e-GmbH
Lords of Heaven - http://www.LoH-Gilde.de (Created with eZ Publish)
German online gaming guild
About me - http://www.NikoGoers.de
My roadmap, +1 are welcome: http://share.ez.no/community/roadmap/10889
|