node_view_gui
Summary
Outputs the view template for a node.Usage
{node_view_gui content_node=node [ view=view_mode [ parameter=value [ ... ] ] ]}
Parameters
Name | Type | Description | Required |
---|---|---|---|
content_node | object | The target node (as an ezcontentobjecttreenode object). | Yes. |
view | string | The view mode that should be used. | Yes. |
parameter | any | Parameter(s) that will be passed to the included template. | No. |
Description
This function makes it possible to display a node using its view (or override) template. The target node must be specified as an "ezcontentobjecttreenode" object using the "content_node" parameter. The "view" parameter specifies which view mode that should be used. All other parameters (of any type) will be passed on and thus become available as template variables in the view template.
Examples
Example 1
{def $my_node=fetch( 'content', 'node', hash( 'node_id', 96 ) )} {node_view_gui view='example' content_node=$my_node}
In this example, node number 96 is fetched and stored in $my_node. The "node_view_gui" function is used to display the target node using the "example" view mode. If there are no override rules for the specified view mode, the system will search for "example.tpl" in the "templates/node/view/" directory of the current design. If the requested template file is not found, eZ Publish will continue searching for it in the fallback designs and the standard design.
Balazs Halasy (06/02/2004 1:17 pm)
Julia Shymova (18/09/2007 12:06 pm)
Comments
Parameter use ?
Wednesday 09 November 2005 11:18:05 am
Alimi Nabil
Which syntax should be used ?
Re: Parameter use ?
Wednesday 12 April 2006 10:26:32 pm
James Robertson
eg.
Re: Re: Parameter use ?
Tuesday 07 October 2008 12:56:47 pm
Adrien
Intention of the various 'Standard' views?
Wednesday 12 April 2006 10:29:03 pm
James Robertson
The content_object is set as $node in the view template.
Wednesday 25 November 2009 12:14:44 pm
Tudor Prodan
Re: The content_object is set as $node in the view template.
Saturday 09 January 2010 8:49:13 am
Christoph von Siebenthal
So great to learn about this in a comment!
Ez would be so much ez(er) if a little bit more common sens like
content_node set as $content_node
or noticing important information at prominent place in the documentation would be used.
That was again 1 hour lost!
Truely I like Ez and find it sad to lose so much energy in details.
Please complete documentation like this
Saturday 09 January 2010 8:58:59 am
Christoph von Siebenthal
Description for content_node:
The target node (as an ezcontentobjecttreenode object). like ...content_node=$my_node... handled as $node in the matching template.
Description for paramaters
parameter any Parameter(s) that will be passed to the included template. Like ...param1='my_string' param2=$my_variable... in this case handle as $param1 and $param2 in the matching template.