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?

eZ debug

Timing: Jan 18 2025 11:16:17
Script start
Timing: Jan 18 2025 11:16:17
Module start 'content'
Timing: Jan 18 2025 11:16:18
Module end 'content'
Timing: Jan 18 2025 11:16:18
Script end

Main resources:

Total runtime0.8610 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0090 587.8594180.8125
Module start 'content' 0.00900.7024 768.6719602.0000
Module end 'content' 0.71140.1496 1,370.6719337.3984
Script end 0.8610  1,708.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5148210.0002
Check MTime0.00160.1804210.0001
Mysql Total
Database connection0.00140.161710.0014
Mysqli_queries0.774989.99311990.0039
Looping result0.00220.26051970.0000
Template Total0.826596.020.4132
Template load0.00260.301220.0013
Template processing0.823995.683820.4119
Template load and register function0.00030.031310.0003
states
state_id_array0.00080.091010.0008
state_identifier_array0.00180.212220.0009
Override
Cache load0.00200.2303670.0000
Sytem overhead
Fetch class attribute can translate value0.00120.135840.0003
Fetch class attribute name0.00110.129950.0002
XML
Image XML parsing0.00150.168640.0004
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00250.2875280.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs