last modified articles

Author Message

justin kazadi

Thursday 13 March 2008 3:47:24 am

hello,

 

I have created an instance of frontpage ( dernierarticle ) this instance have : article1,

article2,...., article5 as sub items .

I want to post only four last modified article what can i do?

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

André R.

Thursday 13 March 2008 1:15:16 pm

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list

Probably something like:

{def $articles = fetch('content', 'list', hash( 'parent_node_id', 2,
                                                  'limit', 4,
                                                  'class_filter_type', 'include',
                                                  'class_filter_array', array( 'article' )
))}

where 2 is the node of the frontpage and 'article' is the class identifier of the article class.
Then you need to loop over them, like this:

{foreach $articles as $article}
{$node.name}<br />
{/foreach}

Take a look at this guide for what you can do next:
http://ez.no/ezpublish/documentation/building_an_ez_publish_site

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

justin kazadi

Friday 14 March 2008 3:05:52 am

hello !!

Thanks a lot of ANDRE R . I have done what you say but i want to have only the 4

most recently modified articles of the parent_node_id=189.

Your code return the first four article of the parent_node_id .

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

André R.

Friday 14 March 2008 3:31:37 am

It was just an example, switch 2 with 189 and it should work.
Check the 1. link for more examples using different filters.
The same code can also be used for subtree fetches by changing out 'list' with 'tree'.

To get the 4 most recent modified, look at that page for how to sort ( look for 'sort_by' ) on modified or publish dates.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

justin kazadi

Friday 14 March 2008 6:46:22 am

hello André R !!
Thanks you for all.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

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

Main resources:

Total runtime0.0184 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.0057 587.9063151.2109
Module start 'layout' 0.00570.0031 739.117236.6328
Module start 'content' 0.00890.0079 775.750098.2344
Module end 'content' 0.01680.0015 873.984437.9922
Script end 0.0184  911.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002714.3967140.0002
Check MTime0.00115.9630140.0001
Mysql Total
Database connection0.00126.323010.0012
Mysqli_queries0.003116.739230.0010
Looping result0.00000.076410.0000
Template Total0.00116.210.0011
Template load0.00094.822210.0009
Template processing0.00021.335010.0002
Override
Cache load0.00063.405610.0006
General
dbfile0.003418.584480.0004
String conversion0.00000.038840.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