Understanding Fetch

Understanding Fetch

Sunday 03 April 2005 8:58:38 pm - 2 replies

Author Message

Ekkehard Dörre

Monday 04 April 2005 12:34:10 am

Hi Richard,

welcome.

It is interesting to see, who and when somebody does some changes on the page, so I made a listing of the latest 40 modified objects, where 2 is the main node of content:

{let news_list=fetch( content, tree, hash( parent_node_id, 2,
                                           limit, 40,
                                           sort_by, array( array( modified , false()) )

                                         ) )}
    {section name=News loop=$news_list}

    <div class="newstitle"><a href={$News:item.url_alias|ezurl}>{$News:item.name|wash}</a></div>

      <div class="date">Published: ({$News:item.object.published|l10n( datetime )})Modified: ({$News:item.object.modified|l10n( datetime )}) by  {$News:item.creator.name}</div>

    {/section}

{/let}

the latest 40 published objects ( only modified is changed to published):

{let news_list=fetch( content, tree, hash( parent_node_id, 2,
                                           limit, 40,
                                           sort_by, array( array( published , false()) )

                                         ) )}
    {section name=News loop=$news_list}

    <div class="newstitle"><a href={$News:item.url_alias|ezurl}>{$News:item.name|wash}</a></div>

      <div class="date">Published: ({$News:item.object.published|l10n( datetime )})Modified: ({$News:item.object.modified|l10n( datetime )}) by  {$News:item.creator.name}</div>

    {/section}

{/let}

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Ekkehard Dörre

Monday 04 April 2005 12:44:30 am

2 is the parent node.
More info:

http://www.ez.no/ez_publish/documentation/customization/tips_tricks/fetch_function_examples

http://www.ez.no/ez_publish/documentation/customization/custom_design/database_connectivity

http://www.ez.no/ez_publish/documentation/reference/data_fetching/content

the mostimportant is tree and list.
http://www.ez.no/ez_publish/documentation/reference/data_fetching/content/tree

http://www.ez.no/ez_publish/documentation/reference/data_fetching/content/list

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.