Display an article content after fetching

Author Message

Franck T.

Friday 31 March 2006 1:00:58 am

This is the code I use to get the last article from the desired folder:

...
{* For each subfolder, fetch the articles *}
	{section loop=$subfolders}
		{let articles=fetch( content,list,
		hash( 'parent_node_id', $:item.node_id,
		sort_by, array( published, false() ), 
		limit, 1,
		class_filter_type, include,
		class_filter_array, array( 'article' )))
	}
									
{* For each article, display the name and the url to the article and the category *}
	{section loop=$articles}
		<dd>
			<a href={$:item.url_alias|ezurl}>{$:item.name}</a>
		</dd>
	{/section}
									
	{/let}

How to change this code if I want to display not the link but the full content of the article itself ? Does something like {$:item.content} exists ?

Per-Espen Kindblad

Friday 31 March 2006 1:22:15 am

You can try:

{section name=Articles loop=$articles}      

<dd>          
{attribute_view_gui attribute=$Articles:item.object.data_map.title}
{attribute_view_gui attribute=$Articles:item.object.data_map.text}

</dd>   

{/section} 

Replace title and text with the attributes of your article-class.

Or it's possible to just use:
{attribute_view_gui attribute=$Articles:item}

Bertrand Dunogier

Friday 31 March 2006 2:00:12 am

You could also use

{node_view_gui content_node=$Articles:item}

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Franck T.

Friday 31 March 2006 2:03:41 am

OK, it works fine.
Thanks a lot and have a nice day !

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 30 2025 22:23:42
Script start
Timing: Jan 30 2025 22:23:42
Module start 'layout'
Timing: Jan 30 2025 22:23:42
Module start 'content'
Timing: Jan 30 2025 22:23:42
Module end 'content'
Timing: Jan 30 2025 22:23:42
Script end

Main resources:

Total runtime0.0263 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2578151.2266
Module start 'layout' 0.00450.0044 739.4844220.7188
Module start 'content' 0.00890.0161 960.2031997.9297
Module end 'content' 0.02500.0013 1,958.132833.9922
Script end 0.0263  1,992.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00259.3732140.0002
Check MTime0.00103.7618140.0001
Mysql Total
Database connection0.00062.273910.0006
Mysqli_queries0.002810.587330.0009
Looping result0.00000.049910.0000
Template Total0.00093.410.0009
Template load0.00072.615810.0007
Template processing0.00020.798810.0002
Override
Cache load0.00051.870510.0005
General
dbfile0.003011.253780.0004
String conversion0.00000.030840.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