Forums / Setup & design / How to accomplish with this? Any Ideas?

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... ;)

eZ debug

Timing: Jan 18 2025 11:00:24
Script start
Timing: Jan 18 2025 11:00:24
Module start 'content'
Timing: Jan 18 2025 11:00:25
Module end 'content'
Timing: Jan 18 2025 11:00:25
Script end

Main resources:

Total runtime1.0085 sec
Peak memory usage4,096.0000 KB
Database Queries183

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0153 588.9453180.8281
Module start 'content' 0.01530.8432 769.7734424.6094
Module end 'content' 0.85850.1500 1,194.3828333.7969
Script end 1.0085  1,528.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00640.6305210.0003
Check MTime0.00360.3563210.0002
Mysql Total
Database connection0.00190.185210.0019
Mysqli_queries0.926291.83741830.0051
Looping result0.00190.18751810.0000
Template Total0.965295.720.4826
Template load0.00210.208620.0011
Template processing0.963195.498220.4816
Template load and register function0.00020.021410.0002
states
state_id_array0.00120.114810.0012
state_identifier_array0.00140.136520.0007
Override
Cache load0.00190.1881370.0001
Sytem overhead
Fetch class attribute can translate value0.00140.142320.0007
Fetch class attribute name0.00050.053010.0005
XML
Image XML parsing0.00030.033320.0002
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00600.5977210.0003
String conversion0.00000.001030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs