How to accomplish with this? Any Ideas?

Author Message

Jerry Jalava

Tuesday 01 July 2003 4:07:13 pm

I need to get newest articles from five specific folders (witch are the categories) and showing only 3 newest articles (No matter in witch category they are)...

The structure:
- Category 1 (Folder)
- Article 1
- Article 2
- Category 2 (Folder)
- Article 1
- Article 2
etc...

If the Category 1's both articles have been published before Category 2's article 2, then I only need to show the Article 1,2 from category 1 and article 1 from category 2...

This is only part of something bigger I'm building put this is something I just can't get to work...

And other problem comes, when I have tens of categories... I need to make a page where I show only one newest article of each category and I need to limit it to 5 categories and articles per page and use navigator for pages...

I found this code from the forums and used it to accomplish the first part of the other problem: "How to show one newest article in each category"...

This is the code I used:
"Top_cat" is the folders id that keeps inside the categories (folders).

{let top_cat=16 used_node=false()}

{section show=is_set($DesignKeys:used.node)}
{set used_node=$DesignKeys:used.node}
{section-else}
{set used_node=$top_cat}
{/section}

{let node_obj=fetch(content,node,hash(node_id,$used_node))}

{section loop=fetch(content,list,hash(parent_node_id,$top_cat,class_filter_type,"include",class_filter_array,array(1),sort_by,array(array(priority))))}
<table width="240" border="0"><tr><td><a class="path" href={$:item.url_alias|ezurl}>{$:item.name}</a></td></tr></table>

{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id,limit,1,class_filter_type,"include",class_filter_array,array(2),sort_by,array(published,false())))}
<table width="240" border="0"><tr><td><a class="path" href={$:item.url_alias|ezurl}>{$:item.name}</a></td></tr></table>

{/section}
{/section}
{/let}
{/let}

Any suggestions are welcome

Thanks already,
Jerry

P.S. I hope even someone understood what I was trying to explain... ;)

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

Main resources:

Total runtime1.1475 sec
Peak memory usage8,192.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.2500151.2266
Module start 'layout' 0.00580.0046 739.4766220.7188
Module start 'content' 0.01031.1362 960.19534,158.2344
Module end 'content' 1.14650.0010 5,118.42977.8281
Script end 1.1475  5,126.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3309160.0002
Check MTime0.00130.1175160.0001
Mysql Total
Database connection0.00100.087810.0010
Mysqli_queries1.060192.3858460.0230
Looping result0.00060.0511440.0000
Template Total1.090095.020.5450
Template load0.00210.181920.0010
Template processing1.087994.802720.5439
Template load and register function0.00200.173110.0020
states
state_id_array0.00090.079410.0009
state_identifier_array0.00150.128720.0007
Override
Cache load0.00170.1512370.0000
Sytem overhead
Fetch class attribute can translate value0.00190.168410.0019
Fetch class attribute name0.00230.200610.0023
XML
Image XML parsing0.00010.008510.0001
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00080.0712100.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs