Forums / Setup & design / Exclude specific folder from fetch

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}