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?

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 16:14:58
Script start
Timing: Jan 18 2025 16:14:58
Module start 'layout'
Timing: Jan 18 2025 16:14:58
Module start 'content'
Timing: Jan 18 2025 16:14:58
Module end 'content'
Timing: Jan 18 2025 16:14:58
Script end

Main resources:

Total runtime0.0133 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.0625152.6406
Module start 'layout' 0.00530.0023 740.703139.4766
Module start 'content' 0.00750.0040 780.179793.3672
Module end 'content' 0.01150.0018 873.546934.3047
Script end 0.0133  907.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002418.0576140.0002
Check MTime0.00107.5645140.0001
Mysql Total
Database connection0.00075.136610.0007
Mysqli_queries0.001712.500930.0006
Looping result0.00000.103710.0000
Template Total0.001410.810.0014
Template load0.00085.885710.0008
Template processing0.00064.843410.0006
Override
Cache load0.00053.967310.0005
General
dbfile0.00032.585380.0000
String conversion0.00000.037540.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