ONE fetch for Several Folders

Author Message

Leandro Alves

Tuesday 29 June 2004 9:02:08 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)..

<b>I don't want any of others articles...</b>

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 <b>ALL articles</b> 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>There is other form to fetch all articles in the specific folders?</b>

Thanks a lot!
Leandro

Mark Gilbert

Thursday 01 July 2004 5:44:21 am

One solution is to create a "News" Class. When you add news to your sight always use the News Class. Then you can do a fetch based on the root - node id of 2 fetching only the "News" class you created. Creating the "News" class would be easy. Just copy the "Article" class and name it "News".

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 31 2025 06:15:15
Script start
Timing: Jan 31 2025 06:15:15
Module start 'layout'
Timing: Jan 31 2025 06:15:15
Module start 'content'
Timing: Jan 31 2025 06:15:15
Module end 'content'
Timing: Jan 31 2025 06:15:15
Script end

Main resources:

Total runtime0.0118 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.0044 588.1250151.2109
Module start 'layout' 0.00440.0018 739.335936.6484
Module start 'content' 0.00620.0044 775.984490.1250
Module end 'content' 0.01060.0011 866.109429.9922
Script end 0.0118  896.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002016.7348140.0001
Check MTime0.00097.8319140.0001
Mysql Total
Database connection0.00076.037910.0007
Mysqli_queries0.002117.783730.0007
Looping result0.00000.068810.0000
Template Total0.00097.310.0009
Template load0.00075.936710.0007
Template processing0.00021.334310.0002
Override
Cache load0.00043.379410.0004
General
dbfile0.00129.927580.0001
String conversion0.00000.036440.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