Forums / General / Display an article content after fetching

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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 !