How to display part of current node

Author Message

Jack Rackham

Wednesday 03 November 2004 1:51:43 pm

I want to display part of a current node (article) in a pagelayout template. How do I do this?

Marko Žmak

Wednesday 03 November 2004 3:02:10 pm

You should specify what you want to display. The Intro, the Title or Body?

If you have a node ($node) you can display his attribute like this:

{attribute_view_gui atribute=$node.object_data_map.intro}

that's for intro. Or you could use something like this:

{$node.object_data_map.title.content}

Check out the documentation for the details, and how to obtain the current node. A useful operator for you is attribute(), check it out in the docs.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Thursday 04 November 2004 1:25:15 am

Hi

I think that u should use {$module_result.node_id} to display node id in pagelayout

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

Jack Rackham

Thursday 04 November 2004 4:36:42 am

I have tried the following functions but it's not working.

{$DesignKeys:used.node.object_data_map.title.content}
{$DesignKeys:used.object.object_data_map.title.content}

{$module_result.node_id.object_data_map.title.content}

{attribute_view_gui atribute=$module_result.node_id.object_data_map.title}

{attribute_view_gui atribute=$DesignKeys:used.node.object_data_map.title}

{attribute_view_gui atribute=$DesignKeys:used.object.object_data_map.title}

Łukasz Serwatka

Thursday 04 November 2004 9:12:47 am

In pagelayout

{let current_node=fetch(content,node,hash(node_id,$module_result.node_id))}

{$current_node.name} {*current node name*}

{attribute_view_gui atribute=$current_node.object.data_map.title}

{/let}

i hope this help

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

Jack Rackham

Thursday 04 November 2004 2:03:54 pm

Ok it works but how do I display, the intro, body ............
I tried to replace title with intro .... but it did not work.

Łukasz Serwatka

Thursday 04 November 2004 2:41:37 pm

Here is a working code

{let current_node=fetch(content,node,hash(node_id,$module_result.node_id))}

{attribute_view_gui attribute=$current_node.data_map.intro}

{/let}

If u need body just replace with intro. There was a syntax error in attribute

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 00:58:33
Script start
Timing: Jan 19 2025 00:58:33
Module start 'layout'
Timing: Jan 19 2025 00:58:33
Module start 'content'
Timing: Jan 19 2025 00:58:34
Module end 'content'
Timing: Jan 19 2025 00:58:34
Script end

Main resources:

Total runtime1.3640 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 590.3906152.6406
Module start 'layout' 0.00590.0030 743.031339.4609
Module start 'content' 0.00881.3535 782.4922638.5391
Module end 'content' 1.36240.0016 1,421.031316.1563
Script end 1.3639  1,437.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2511160.0002
Check MTime0.00140.1050160.0001
Mysql Total
Database connection0.00090.067510.0009
Mysqli_queries1.287394.3740710.0181
Looping result0.00070.0510690.0000
Template Total1.331597.620.6657
Template load0.00230.171820.0012
Template processing1.329197.443020.6646
Template load and register function0.00020.012310.0002
states
state_id_array0.00090.069110.0009
state_identifier_array0.00170.122720.0008
Override
Cache load0.00190.1377400.0000
Sytem overhead
Fetch class attribute can translate value0.00060.042730.0002
Fetch class attribute name0.00090.0672100.0001
XML
Image XML parsing0.00300.220930.0010
class_abstraction
Instantiating content class attribute0.00000.0023140.0000
General
dbfile0.00230.1682320.0001
String conversion0.00000.000540.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
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs