One fetch for several Folders

Author Message

Leandro Alves

Wednesday 30 June 2004 8:35:18 am

Hi!

I am trying to use one fetch for several folders, but I have a problem!

I have this structure:

Root Folder (node_id = 2)
|_Sales
...|_News (node_id = 10)
......|article 1
......|article 2
...|_Documents
......|article X
|_Account
...|_News (node_id = 20)
......|article 3
......|text 1

I want to fetch all articles that are only in both folders "News" (Node 10 and 20)..

I don't want any of others articles...

I tried with the <i>search operator</i> with this code, but it didn't resolve my problem:

{let search=fetch(content,search,hash(text,'article',subtree_array, array(10,20)))}

{section var=SearchResult loop=$search['SearchResult']}
<a href={$SearchResult.item.url_alias|ezurl}>{$SearchResult.item.name|wash}</a>
{attribute_view_gui attribute=$SearchResult.object.data_map.intro}
{/section}

{/let}

<b>Problem</b>

1. The parameter text in search operator is required, so What can I do to fetch ALL articles in both folders??
In this case the fetch only catch the article with the "article" word, but not all. The fetch didn't catch the article "text 1" in "Account/News"...

For test I changed my site.ini.append allowing empty searches but it didn't work with the fetch operator too...

[SearchSettings]
AllowEmptySearch=enabled

I tried several forms in "(text,'article')"...
One of its:
{let search=fetch(content,search,hash(text,'', subtree_array, array( 10, 20 )))}

But nothing worked...

I prefer don't allow empty searches, It was only a test...

What can I do in this case?

<b>Is there other form to fetch all articles in the specific folders?</b>

Thanks a lot!
Leandro

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