Forums / Setup & design / Understanding Fetch

Understanding Fetch

Author Message

Richard Cesar

Sunday 03 April 2005 8:58:38 pm

Hello,

First off I am having problems finding any sort of basic syntax referance for ez-publish, and having some would make asking these questions rather pointless, so if you can direct me to one that would be a help, otherwise, please continue :).

At the moment my problem centers around the most major component of the template, the fetch() function. My original idea was to stream information (articals, weblogs, etc.) from multiple nodes, all on the home page, the problem is there is no information on potential commands for the hash function that I seem to find used within fetch.., and everything I have been trying has failed to yield reasonable output. What I attempted doing was to fetch content from multiple parent nodes (specified in the hash) limit it to a maximum amount of each (at 3 articals/weblogs/etc), seems like fairly basic stuff, in fact I could swear for a second I had it working, but how I accomplished it I have no idea. As For the parent node I tried both the content folder, and the section node id, neither of which proved to give any sort of information. I planned on using multiple fetch statements to stream content from multiple nodes, but so far this just isnt working. Any advice, pointers, referances, etc. you could provide would be helpfull... if anyone can say what they did in this case that would also work.

Using 3.5.1

Thanks,
Richard

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

eZ debug

Timing: Jan 19 2025 06:05:10
Script start
Timing: Jan 19 2025 06:05:10
Module start 'content'
Timing: Jan 19 2025 06:05:12
Module end 'content'
Timing: Jan 19 2025 06:05:12
Script end

Main resources:

Total runtime1.2507 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.9297180.8438
Module start 'content' 0.00481.1052 769.7734551.6875
Module end 'content' 1.11010.1405 1,321.4609336.7734
Script end 1.2506  1,658.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3133210.0002
Check MTime0.00140.1113210.0001
Mysql Total
Database connection0.00050.037910.0005
Mysqli_queries1.175994.02041940.0061
Looping result0.00200.16091920.0000
Template Total1.221397.720.6107
Template load0.00200.160020.0010
Template processing1.219397.493720.6097
Template load and register function0.00020.016910.0002
states
state_id_array0.00160.126210.0016
state_identifier_array0.00120.095920.0006
Override
Cache load0.00160.1298290.0001
Sytem overhead
Fetch class attribute can translate value0.00190.151930.0006
Fetch class attribute name0.00160.126040.0004
XML
Image XML parsing0.00100.081830.0003
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00630.5066270.0002
String conversion0.00000.000330.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs