fetching news

Author Message

andrea giorgini

Monday 20 August 2007 8:04:47 am

Hi all,

first timer here :-)

I am following the "Building an eZ Publish site" (even if I understand it is old) document just to get warm with the CMS.

I am overriding the latest news template, and following the doc I wrote:

<h1>Latest news</h1>

{let children = fetch(content, list, hash(parent_node_id, $node.node_id
										  sort_by, $node.sort_array,
										  limit, 7,
										  class_filter_type, include,
										  class_filter_array, array('article')
										  )
					)
}

{section name=Child loop=$children}
	{node_view_gui view=line content_node=$Child:item}
	<hr />
{/section}

{/let}

Now I get the following error from the debug:

parser error @ design/tscm/override/templates/full_view_news_folder.tpl:3
Empty variable name at [(content, list, hash(parent_node_id, $node.node_id
sort_by, $node.sort_array,
limit, 7,
class_filter_type, include,
class_filter_array, array('article')
)
)
]

What am I doing wrong?
Thx a lot

Andrea

Felix Laate

Monday 20 August 2007 11:26:43 am

Hi Andrea,

welcome to the forum.

I think there is something wrong with your fetch-syntax. It should look something like this, I think:

{fetch( 'content', 'list',
        hash( 'parent_node_id', $node.node_id,
                 'class_filter_type',  'include',
                 'class_filter_array', array( 'folder' )
                 'sort_by', array( 'published', false() ) ) )}

For more info:
http://ez.no/doc/ez_publish/technical_manual/3_9/reference/modules/content/fetch_functions/list

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

andrea giorgini

Tuesday 21 August 2007 12:20:20 am

Hey Felix,

thx a lot for the welcome and for your answer.
I found out there was a comma missing after $node.node_id, what a stupid mistake.

Thx again!

Andrea

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 21:03:03
Script start
Timing: Jan 18 2025 21:03:03
Module start 'layout'
Timing: Jan 18 2025 21:03:03
Module start 'content'
Timing: Jan 18 2025 21:03:04
Module end 'content'
Timing: Jan 18 2025 21:03:04
Script end

Main resources:

Total runtime1.0375 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.0058 587.7891152.6094
Module start 'layout' 0.00590.0026 740.398439.4141
Module start 'content' 0.00851.0275 779.8125536.6406
Module end 'content' 1.03600.0015 1,316.453112.1953
Script end 1.0375  1,328.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3091160.0002
Check MTime0.00130.1258160.0001
Mysql Total
Database connection0.00080.074310.0008
Mysqli_queries0.988195.2323570.0173
Looping result0.00060.0545550.0000
Template Total1.006697.020.5033
Template load0.00200.189020.0010
Template processing1.004696.826820.5023
Template load and register function0.00020.020510.0002
states
state_id_array0.00100.094910.0010
state_identifier_array0.00110.109420.0006
Override
Cache load0.00160.1570360.0000
Sytem overhead
Fetch class attribute can translate value0.00060.060320.0003
Fetch class attribute name0.00090.089340.0002
XML
Image XML parsing0.00040.040220.0002
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00150.1433160.0001
String conversion0.00000.000840.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
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/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: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs