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

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 18 2025 21:15:54
Script start
Timing: Jan 18 2025 21:15:54
Module start 'layout'
Timing: Jan 18 2025 21:15:54
Module start 'content'
Timing: Jan 18 2025 21:15:55
Module end 'content'
Timing: Jan 18 2025 21:15:55
Script end

Main resources:

Total runtime0.6703 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9063152.6250
Module start 'layout' 0.00560.0032 740.531339.4453
Module start 'content' 0.00880.6603 779.9766552.4688
Module end 'content' 0.66910.0012 1,332.445312.1641
Script end 0.6703  1,344.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4761160.0002
Check MTime0.00140.2033160.0001
Mysql Total
Database connection0.00070.100610.0007
Mysqli_queries0.615391.7895600.0103
Looping result0.00050.0764580.0000
Template Total0.635594.820.3177
Template load0.00200.295920.0010
Template processing0.633594.506520.3167
Template load and register function0.00030.038010.0003
states
state_id_array0.00130.193210.0013
state_identifier_array0.00070.109720.0004
Override
Cache load0.00170.2520340.0000
Sytem overhead
Fetch class attribute can translate value0.00050.067620.0002
Fetch class attribute name0.00150.219350.0003
XML
Image XML parsing0.00050.070020.0002
class_abstraction
Instantiating content class attribute0.00000.002260.0000
General
dbfile0.00190.2825160.0001
String conversion0.00000.001540.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
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
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs