fetch all articles

Author Message

risto CMS user

Tuesday 07 February 2006 8:43:01 am

Id like to fetch all publishd articles no matter where they are published an display thee latest 10. Can someone show me this? I cant figure out how to make it independent of "location"

Stephen Martin

Tuesday 07 February 2006 2:03:17 pm

I think you're looking for the Tree function:

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/tree

You can limit the results to 10 and select that you only want to return a list of articles by defining the class_filter_type.

Steph A

Saturday 11 February 2006 10:59:19 am

This code fetches nodes under the mainnode. Just set "depth" and "limit" to desired value.

{* Fetch some content *}
{let children=fetch( content, list, hash( parent_node_id, 2,
                                     sort_by, array( published, false() ),
                                     depth,10,
                                     limit,10,
                                     class_filter_type, include,
                                     class_filter_array, array( 'article' ) ) )}
{section name=Child loop=$children}
    {node_view_gui view=line content_node=$Child:item}
{/section}
{/let}

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

Main resources:

Total runtime0.0261 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1094151.1953
Module start 'layout' 0.00570.0035 739.3047220.6563
Module start 'content' 0.00930.0154 959.9609997.8047
Module end 'content' 0.02470.0014 1,957.765629.9922
Script end 0.0261  1,987.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.4330140.0002
Check MTime0.00114.1407140.0001
Mysql Total
Database connection0.00103.781910.0010
Mysqli_queries0.00197.102030.0006
Looping result0.00000.050210.0000
Template Total0.00103.810.0010
Template load0.00083.062610.0008
Template processing0.00020.750410.0002
Override
Cache load0.00062.174410.0006
General
dbfile0.003312.665880.0004
String conversion0.00000.033840.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