Forums / Setup & design / I can't catch the error

I can't catch the error

Author Message

Børge Warvik

Monday 30 January 2006 1:26:20 am

In a template I do this:

<div class="cbox">

<h3>Eksterne linker</h3>

{def $links=fetch('content', 'list', hash('parent_node_id', 84, 'sort_by', 'short_name', 'class_filter_type', 'include', 'class_filter_array', array('link')))}

<ul>
{foreach $links as $link}
<li><a href="{attribute_view_gui attribute=$link.object.data_map.url}">{attribute_view_gui attribute=$link.object.data_map.short_name}</a></li>
{/foreach}
</ul>
</div>

Everything is working fine, but my debug output gives me this error. The error is printed for each of the $link items of $links:

Error: eZTemplate @ design/nifab/override/templates/frontpage_full.tpl:13[13]
No such attribute for array(4): url
Choose one of following: name, short_name, description, location
Warning: eZTemplate:attribute_view_gui
Parameter attribute is not an object

What am I doing wrong?

Børge Warvik

Monday 30 January 2006 1:44:30 am

Figured this one out eventually :)

David Boman

Monday 30 January 2006 1:50:13 am

Can you give us some hints? I have a lot of these and I'm not really sure how to start debugging them...

Børge Warvik

Monday 30 January 2006 2:14:11 am

I was wrong! My code didn't work at all, it just looked like it did. It turned out that my $node didn't have a url attribute.

So printing the link like this:

<a href="{attribute_view_gui attribute=$link.object.data_map.url}"> {attribute_view_gui attribute=$link.object.data_map.name} </a>

Will give you links on the page, but if you view the the source you'll see:

<a href="">[name of link]</a>

It turns out that you need to use the attribute location, like this:

{attribute_view_gui attribute=$link.object.data_map.location}

That will give you all you need including wrapping the link in the a tag for you!

Hope that answers it

eZ debug

Timing: Jan 19 2025 01:05:32
Script start
Timing: Jan 19 2025 01:05:32
Module start 'content'
Timing: Jan 19 2025 01:05:33
Module end 'content'
Timing: Jan 19 2025 01:05:33
Script end

Main resources:

Total runtime0.8149 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 590.0625180.8438
Module start 'content' 0.00640.6557 770.9063525.9609
Module end 'content' 0.66210.1527 1,296.8672336.7578
Script end 0.8148  1,633.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.5613210.0002
Check MTime0.00170.2052210.0001
Mysql Total
Database connection0.00100.123510.0010
Mysqli_queries0.735390.23131970.0037
Looping result0.00220.27161950.0000
Template Total0.785296.420.3926
Template load0.00220.270320.0011
Template processing0.783096.089820.3915
Template load and register function0.00010.011810.0001
states
state_id_array0.00080.099810.0008
state_identifier_array0.00100.119120.0005
Override
Cache load0.00180.2270250.0001
Sytem overhead
Fetch class attribute can translate value0.00230.278430.0008
Fetch class attribute name0.00170.213150.0003
XML
Image XML parsing0.00090.113330.0003
class_abstraction
Instantiating content class attribute0.00000.001670.0000
General
dbfile0.00180.2183270.0001
String conversion0.00000.000630.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0003 secs