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}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:22:09
Script start
Timing: Jan 18 2025 16:22:09
Module start 'layout'
Timing: Jan 18 2025 16:22:09
Module start 'content'
Timing: Jan 18 2025 16:22:09
Module end 'content'
Timing: Jan 18 2025 16:22:09
Script end

Main resources:

Total runtime0.0151 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.0313152.6406
Module start 'layout' 0.00560.0032 740.671939.4766
Module start 'content' 0.00880.0043 780.148489.3359
Module end 'content' 0.01310.0019 869.484434.3047
Script end 0.0150  903.7891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.9536140.0002
Check MTime0.00117.6019140.0001
Mysql Total
Database connection0.00064.100710.0006
Mysqli_queries0.003120.396230.0010
Looping result0.00000.264210.0000
Template Total0.001610.410.0016
Template load0.00095.712910.0009
Template processing0.00074.664010.0007
Override
Cache load0.00063.822310.0006
General
dbfile0.00021.597980.0000
String conversion0.00000.068040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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