Forums / Setup & design / How to make a "box" with content from a News folder?

How to make a "box" with content from a News folder?

Author Message

Robin Sørlie

Wednesday 18 June 2003 9:02:21 am

Tried to search around, didn't find something that made this clearer.

In a News folder I have my News articles. I want the title and intro of the news to be shown in a box on the right side of the site. Something like the My Company (section 6) section i demo edition. I manage to show the title, but not the intro.

In my pagelayout template I have:

{news_list=fetch(content,list,hash(parent_node_id,159,limit,5,sort_by,array(published,false()),class_filter_type,include,class_filter_array,array(2)))}

And:

<table class="menu" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th class="menuhead">
News
</th>
</tr>
{section name=News loop=$news_list}
<tr>
<td class="menuitem">

<div class="menuname">
<a href={concat('content/view/full/',$News:item.node_id)|ezurl}>{$News:item.name|wash}</a>
</div>
<div class="menudate">({$News:item.object.published|l10n(shortdate)})</div>

</td>
</tr>
{delimiter}
{/delimiter}
{/section}
</table>

This works, but instead of showing the date of published, I want to show the Intro of the article. I have tried a dozen of different combination with no luck. Apperantly attribute_view_gui won't work here. Any suggestions?

Paul Borgermans

Wednesday 18 June 2003 10:04:11 am

Try the following (and define div.menuintro in your css file)

<table class="menu" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th class="menuhead">
News
</th>
</tr>
{section name=News loop=$news_list}
<tr>
<td class="menuitem">

<div class="menuname">
<a href={concat('content/view/full/',$News:item.node_id)|ezurl}>{$News:item.name|wash}</a>
</div>
<div class="menuintro">
{atttribute_view_gui attribute=$News:item.datamap.intro}
</div>
<div class="menudate">({$News:item.object.published|l10n(shortdate)})</div>

</td>
</tr>
{delimiter}
{/delimiter}
{/section}
</table>

--paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Robin Sørlie

Thursday 19 June 2003 12:21:42 am

Thx for quick answer but it doesn't seem to work either. The news list also stopps when the {atttribute_view_gui attribute=$News:item.datamap.intro} should be printed, no more news are listed. Any other suggestion?

Alexei Pechekhonov

Thursday 19 June 2003 12:31:33 am

Paul, hm... it looks like eZ publish stoped to use his great feature view=some_my_view
Because the debugger says even on demo:
tpl code:
{node_view_gui view=menu content_node=$News:item}

>>Warning: eZTemplate:node_view_gui
None of the templates design:node/view/menu.tpl could be found <<

That is the reason why we can't see short-menu view on right hand column
on demo (3.1 and current SVN 2751 as well).
It means, if target folder consists not only News-class objects we should set {node_view_gui content_node=$News:item.data_type.identifier_you_want_to_show} for every classes? In previous version it was very eazy to create view tpl's for appropriated classes. What should we do now? Is it new eZ aproach from SVN 2444? (3.1, 3.1.1 beta 2). What do you think?
How is the {node_view_gui view=... } should be used now?