Exclude specific folder from fetch

Author Message

Siw Helen Thorslund

Monday 25 April 2005 5:48:55 am

I have this code for a fetch of the left menu:

{let first_level=fetch( 'content', 'list', hash( 'parent_node_id', 2,
			'class_filter_type', 'include',
			'limit', 10,
			'sort_by', array( priority, true() ),
			'class_filter_array', array( 'folder', 'feedback_form' ) ) )}

This works fine, and fetch all the folders and feedback forms.

I want one of the folders with the ID 102 (and title "Archive") left out of the fetch.
How can I manage to do that?

Thanx in advance...

www.VZT.no ( http://www.VZT.no )
VZT References ( http://http://vzt.no/index.php/vzt_eng/referanser )
VZT Extensions ( http://vzt.no/index.php/vzt_eng/extensions )
www.MediaBase.no ( http://www.MediaBase.no )

Eivind Marienborg

Monday 25 April 2005 5:58:31 am

You could do a switch on the parent_node_id in the loop of the result.

As far as I know there is no node_filter_type/node_filter_array possibility, but it has been posted as a suggestion.

Felix Laate

Monday 25 April 2005 6:01:29 am

Hi Siw!

I'm sure there more ways to do this, but one way would be to use a attribute-filter in your fetch:

attribute_filter, array( array( 'folder/title', '!=', 'Archive' ) )

or something like that..

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Siw Helen Thorslund

Monday 25 April 2005 10:57:17 pm

I change the code to:


{let first_level=fetch( 'content', 'list', hash( 'parent_node_id', 2,
			'class_filter_type', 'include',
			'limit', 10,
			'sort_by', array( priority, true() ),
			'class_filter_array', array( 'folder', 'feedback_form' ),
			'attribute_filter', array( array( 'folder/title', '!=', 'Archive' ) ) ) )}

But this time i do not get any result at all...

Any suggestions?

www.VZT.no ( http://www.VZT.no )
VZT References ( http://http://vzt.no/index.php/vzt_eng/referanser )
VZT Extensions ( http://vzt.no/index.php/vzt_eng/extensions )
www.MediaBase.no ( http://www.MediaBase.no )

Tore Skobba

Monday 25 April 2005 11:51:37 pm

Hi

One easy way is to fetch all, then when you do your itterations check for folder 102. I.e

{section loop=$first_level}
{section show=$item.node_id|eq(102)}
{* Do nothing *}
{section-else}
{* Do your actions *}

{/section}
{/section}

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 19 2025 07:25:29
Script start
Timing: Jan 19 2025 07:25:29
Module start 'layout'
Timing: Jan 19 2025 07:25:29
Module start 'content'
Timing: Jan 19 2025 07:25:29
Module end 'content'
Timing: Jan 19 2025 07:25:29
Script end

Main resources:

Total runtime0.0173 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.2578152.6250
Module start 'layout' 0.00630.0045 741.882839.4453
Module start 'content' 0.01080.0046 781.328193.4609
Module end 'content' 0.01540.0019 874.789138.3047
Script end 0.0173  913.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003218.4547140.0002
Check MTime0.00116.5504140.0001
Mysql Total
Database connection0.00105.831110.0010
Mysqli_queries0.003117.864830.0010
Looping result0.00000.079810.0000
Template Total0.00158.410.0015
Template load0.00084.534310.0008
Template processing0.00073.876910.0007
Override
Cache load0.00063.207110.0006
General
dbfile0.00021.109880.0000
String conversion0.00000.050940.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