Hello,
I have been trying to create some dynamic content (A sidebar) and have it display different content dynamically.
I have working solution but it is not the way I expected it to work.
In the layout I have the following code
PHP Code:
<div class="mainContent">
<div class="rightContent">
<?php echo $this->action('policy','right'); ?>
</div>
<div class="leftContent">
<?php echo $this->layout()->content; ?>
</div>
</div>
I have a RightController that deals with dynamic side of things and this actually works well. The problem is I wanted to assign the output of
PHP Code:
<?php echo $this->action('policy','right'); ?>
in the Controllers so that I can just have the following in the layout
PHP Code:
<?php echo $this->layout()->sidebar; ?>
Below is the code for my Init Function for a controller.
PHP Code:
function init()
{
$response = $this->getResponse();
$response->insert('footer', $this->view->render('/footer/footer.phtml'));
$this->view->section = 'policy';
}
What do I need to do to get the Controller to assign a content body sidebar.
I have tried
PHP Code:
$response->insert('sidebar', $this->view->action('policy','right'));
Which did generate the sidebar but consequently it removes the main content. Any help would be much appriciated.
Thanks
Madmaxious