Forums / Setup & design / exclude one specific node in a fetch

exclude one specific node in a fetch

Author Message

Bjørn Kaarstein

Tuesday 17 June 2003 5:33:10 am

Hi.

I have an ordinary fetch to create a menu. Like this:

{let
folders=fetch( 'content', 'list', hash( parent_node_id, 2,
sort_by, array( array( priority, true() ) ),
class_filter_type, include,
class_filter_array, array( 1 ) ) ) }

{/let}

Now, what I want to do is to exclude just one folder from being displayed.

Something like node_filter_type, exclude, node_filter_array,(274) would have been nice :) , node 274 being the one I want to exclude from the listing...
Any suggestions?

Regards Bjørn.

Paul Borgermans

Tuesday 17 June 2003 9:30:26 am

A simple way of achieving this:

Clone the class (and related templates) of the node you want to avoid to show, create the node again as being an instance of this class and then use an exclude for this class (or an include leaving out the one you do not want).

I did something similar to have "special" types of forum messages which behave differently from the normal ones.

--paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Bjørn Kaarstein

Wednesday 18 June 2003 1:24:23 am

Thanks a lot Paul.

Works like a charm.

Regards Bjørn.

Ibrahim Khachab

Friday 25 July 2003 5:47:27 am

Another solution may be using a section within your template
For example if you wish to exclude the folder by knowing it's id

{let folders=fetch( 'content', 'list', hash( parent_node_id, 2,
sort_by, array( array( priority, true() ) ),
class_filter_type, include,
class_filter_array, array( 1 ) ) ) }
{section name=controll show=ne($folders:item.node_id, folder_id_to_exclude)} <--- add this section
{/section}

{/let}