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

eZ debug

Timing: Jan 19 2025 00:54:48
Script start
Timing: Jan 19 2025 00:54:48
Module start 'content'
Timing: Jan 19 2025 00:54:49
Module end 'content'
Timing: Jan 19 2025 00:54:49
Script end

Main resources:

Total runtime0.7477 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.9453180.8438
Module start 'content' 0.00680.6006 769.7891557.5469
Module end 'content' 0.60750.1402 1,327.3359336.7578
Script end 0.7477  1,664.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.5515210.0002
Check MTime0.00150.2018210.0001
Mysql Total
Database connection0.00080.103810.0008
Mysqli_queries0.664188.81981970.0034
Looping result0.00220.30051950.0000
Template Total0.718496.120.3592
Template load0.00190.259020.0010
Template processing0.716495.810920.3582
Template load and register function0.00020.027810.0002
states
state_id_array0.00110.141210.0011
state_identifier_array0.00070.093120.0003
Override
Cache load0.00170.2254340.0000
Sytem overhead
Fetch class attribute can translate value0.00150.194630.0005
Fetch class attribute name0.00150.204350.0003
XML
Image XML parsing0.00390.518730.0013
class_abstraction
Instantiating content class attribute0.00000.002060.0000
General
dbfile0.00841.1244270.0003
String conversion0.00000.001130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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