Forums / General / view_paramters does not work

view_paramters does not work

Author Message

Oliver Dzierzon

Tuesday 10 February 2009 4:05:56 am

Once again I have a problem. ;-)

I'am using the following code

{foreach fetch_alias('formular',hash('parent_node_id', $module_result.node_id)) as $article}
	{node_view_gui view="anfragenAllgemein" content_node=$article.contentobject_id}
{/foreach}

All works fine. The only thing which seems not to work proper is the parameter transmission to the view "anfragenAllgemein". When I put

{$view_parameters.content_node}

into the existing template "templates/node/view/anfragenAllgemein.tpl" there is no parameter value displayed.

Thank you

ciao Olli

Gaetano Giunta

Tuesday 10 February 2009 4:16:14 am

you can add view_parameters=$view_parameters to your node_view_gui function call

Principal Consultant International Business
Member of the Community Project Board

Oliver Dzierzon

Tuesday 10 February 2009 4:57:40 am

OK, now I use the following code

{foreach fetch_alias('formular',hash('parent_node_id', $module_result.node_id)) as $article}
	{node_view_gui view="anfragenAllgemein" content_node=$article view_parameters=$view_parameters}
{/foreach}

and the output Code

{$view_parameters | attribute(view,1)}

displays the the parameters except the parameter "content_node" which I thought I transmitted by the node_view_gui call parameter "content_node=$article"

How can I get access to parameters which I defined in the function call.

ciao

Gaetano Giunta

Tuesday 10 February 2009 8:37:34 am

Close but no cigar... ;-)

You can look up the docs here: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_functions/visualization/node_view_gui

In short:

param content_node => will be present in your node templates as $node, just as it always is available in a node template when called using the system url, eg. node/view/anfragenAllgemein/2

For any other param that you add to node_view_gui calls, this one is takes as is and a variable of the same name is made available to your template

{node_view_gui view="xxx" content_node=$contentobject_id a=$a b=$contentobject_id}

will create 3 variables to be used in your node view tpl: $a, $b and $node

Please note that for content_node you need to pass the actual node object, not its id.
So your code should like:
{node_view_gui view="anfragenAllgemein" content_node=$article view_parameters=$view_parameters}

Principal Consultant International Business
Member of the Community Project Board