attribute view gui issue

Author Message

j jevack

Wednesday 02 November 2005 4:09:19 am

When I use {$node.object.data_map.page_body.content} I get the contents of the page_body attribute but when I use {attribute_view_gui attribute=$node.object.data_map.page_body.content} nothing is returned...the page is blank.

Can someone explain what I am doing wrong?

Regards,

Jason

Łukasz Serwatka

Wednesday 02 November 2005 4:17:16 am

Using {$node.object.data_map.page_body.content} gives direct output from your attribute, using {attribute_view_gui attribute=$node.object.data_map.page_body} will load template releted with page_body datatype. If you will go to design/standard/templates/content/datatype/view and preview eztext.tpl you will see code

{$attribute.content|wash( xhtml )|nl2br}

$attribute in case where you use {attribute_view_gui attribute=$node.object.data_map.page_body} holds $node.object.data_map.page_body

But you can display content of your attribute without using attribute_view_gui like $node.object.data_map.page_body.content.

Correct code for attribute_view_gui is {attribute_view_gui attribute=$node.object.data_map.page_body}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

j jevack

Wednesday 02 November 2005 4:29:37 am

Thank you Lukasz.

Which way is "correct" to display content? What does benefits does using attribute_view_gui provide?

Regards,

Jason

Łukasz Serwatka

Wednesday 02 November 2005 4:58:39 am

Depends on needs. Output from attribute_view_gui is template based so, you can add changes in output presentation in one place (change one template e.g eztext.tpl) and changes will affect in every place of your website.

If you need some "special" output presentation in one place of website then you can omit attribute_view_gui and use $node.object.data_map.page_body.content, so display content directly from attribute.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

j jevack

Wednesday 02 November 2005 5:07:46 am

Thank you. This was very helpful.

We are new eZ publish users and fast becoming big fans.

Regards,

Jason

Łukasz Serwatka

Wednesday 02 November 2005 5:12:34 am

You are welcome :) If you will have any other questions feel free to ask here ;)

Good luck!

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 19 2025 04:25:24
Script start
Timing: Jan 19 2025 04:25:24
Module start 'layout'
Timing: Jan 19 2025 04:25:24
Module start 'content'
Timing: Jan 19 2025 04:25:25
Module end 'content'
Timing: Jan 19 2025 04:25:25
Script end

Main resources:

Total runtime0.9184 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 589.1563152.6250
Module start 'layout' 0.00450.0029 741.781339.4453
Module start 'content' 0.00740.9094 781.2266565.8672
Module end 'content' 0.91680.0016 1,347.093816.4766
Script end 0.9183  1,363.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3262160.0002
Check MTime0.00120.1295160.0001
Mysql Total
Database connection0.00060.064110.0006
Mysqli_queries0.859593.5882660.0130
Looping result0.00070.0759640.0000
Template Total0.887096.620.4435
Template load0.00170.189320.0009
Template processing0.885296.387720.4426
Template load and register function0.00020.025810.0002
states
state_id_array0.00100.104310.0010
state_identifier_array0.00180.201120.0009
Override
Cache load0.00140.1533320.0000
Sytem overhead
Fetch class attribute can translate value0.00090.103220.0005
Fetch class attribute name0.00130.141970.0002
XML
Image XML parsing0.00070.072620.0003
class_abstraction
Instantiating content class attribute0.00000.002390.0000
General
dbfile0.00160.1703180.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs