How Can I create a block for last updated articles ?

Author Message

Pierre SCALFATI

Tuesday 03 March 2009 3:06:24 am

Hello Everybody,

I'm trying to find a way to get the 2, 3 or 4 last updated articles of each part of my EZP site. Something which could resemble to this and which could be displayed in my homepage :

----------------------------------------------
LAST UPDATES
----------------------------------------------
> Press review
Article title 1
Article title 2
> Photo Gallery
My photo title 1
My photo title 2
> Accredidations
Article title 1
Article title 2
...
Is there any EZP extension which could do the job or shall I have to do it by myself ? If somebody can help me on the fetch command/depth syntax which could help me,

How can I make it possible to parameter saying what number of articles I want to get for each section ?

Many thanks.

Jean-Yves Zinsou

Tuesday 03 March 2009 4:58:26 am

You may find your answer here ....

http://localhost/ezdoc4/4_0/reference/modules/content/fetch_functions/tree.html

fetch( 'content', 'tree',
hash( 'parent_node_id', parent_node_id,
[ 'sort_by', sort_by, ]
[ 'offset', offset, ]
[ 'limit', limit, ]
[ 'attribute_filter', attribute_filter, ]
[ 'extended_attribute_filter', extended_attribute_filter, ]
[ 'class_filter_type', class_filter_type, ]
[ 'class_filter_array', class_filter_array, ]
[ 'only_translated', only_translated, ]
[ 'language', language, ]
[ 'main_node_only', main_node_only, ]
[ 'as_object', as_object, ]
[ 'depth', depth, ]
[ 'depth_operator', depth_operator ]
[ 'limitation', limitation ]
[ 'ignore_visibility', ignore_visibility ] ) )

you may need to do several fetches to get the articles , one fetch for each of the parent nodes press review, photo gallery ...
For each of those, the "limit" parameter allows you to choose how many nodes you want to retrieve...

Hope this helps !

Regards

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

Pierre SCALFATI

Tuesday 03 March 2009 7:28:29 am

OK, I'll try this and tell you if it worked, many thanks :-)

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 18 2025 22:37:09
Script start
Timing: Jan 18 2025 22:37:09
Module start 'layout'
Timing: Jan 18 2025 22:37:09
Module start 'content'
Timing: Jan 18 2025 22:37:09
Module end 'content'
Timing: Jan 18 2025 22:37:09
Script end

Main resources:

Total runtime0.6545 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.1719152.6406
Module start 'layout' 0.00770.0046 741.812539.4922
Module start 'content' 0.01230.6406 781.3047537.3125
Module end 'content' 0.65280.0016 1,318.617212.1250
Script end 0.6544  1,330.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.6583160.0003
Check MTime0.00160.2469160.0001
Mysql Total
Database connection0.00140.209810.0014
Mysqli_queries0.593090.6090570.0104
Looping result0.00050.0839550.0000
Template Total0.618994.620.3094
Template load0.00260.392620.0013
Template processing0.616394.166520.3082
Template load and register function0.00020.027610.0002
states
state_id_array0.00100.152610.0010
state_identifier_array0.00160.249720.0008
Override
Cache load0.00210.3145480.0000
Sytem overhead
Fetch class attribute can translate value0.00050.083520.0003
Fetch class attribute name0.00130.193940.0003
XML
Image XML parsing0.00080.128320.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00090.1343160.0001
String conversion0.00000.001840.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs