Greetings,
How to change the value of a variable in a template hook that affects the variable in the parent that calls the hook?
Setup is...
In Template:
conversation_comment_item
Contains this:
{vb:template conversation_footer, conversation={vb:raw conversation}, controls={vb:raw footerControls}}
In Template:
conversation_footer
Contains this:
{vb:hook 'conversation_footerright'}
So template conversation_comment_item calls template conversation_footer and passes footerControls as controls.
conversation_footer contains the hook: conversation_footerright
I added a template hook:
Hook Location: conversation_footerright
Template Name: hook_change_vote_ctrl
Hook Arguments: controls=controls
Created template: hook_change_vote_ctrl
Which contains only this...
{vb:set controls.showVoteCtrl, 1}
All this works as expected, except it has no effect on the "controls" variable in the parent template.
So the hook system does not allow changes to variables just using templates and hooks?
Or did I missing some step?
--
{vb:debugvardump}
How to change the value of a variable in a template hook that affects the variable in the parent that calls the hook?
Setup is...
In Template:
conversation_comment_item
Contains this:
{vb:template conversation_footer, conversation={vb:raw conversation}, controls={vb:raw footerControls}}
In Template:
conversation_footer
Contains this:
{vb:hook 'conversation_footerright'}
So template conversation_comment_item calls template conversation_footer and passes footerControls as controls.
conversation_footer contains the hook: conversation_footerright
I added a template hook:
Hook Location: conversation_footerright
Template Name: hook_change_vote_ctrl
Hook Arguments: controls=controls
Created template: hook_change_vote_ctrl
Which contains only this...
{vb:set controls.showVoteCtrl, 1}
All this works as expected, except it has no effect on the "controls" variable in the parent template.
So the hook system does not allow changes to variables just using templates and hooks?
Or did I missing some step?
--
{vb:debugvardump}
Comment