Let's say I want to display the specials module on the homepage in a position different than $content_top, $content_bottom, $column_left or $column_right. How do I do that? If you have some experience with this, could you give me some pointers?
The module will be display in home.tpl but I'm assuming I would need to edit the controller file home.php
To do this, you will need to make edits to two files
Firstly, you will need to edit the controller. In this example, I'm going to add the specials to the home page
So open the controller file catalog/controller/common/home.php
. Somewhere before this line $this->response->setOutput($this->render());
add the following
$this->data['special_block'] = $module = $this->getChild('module/special', array(
'limit' => 5,
'image_width' => 80,
'image_height' => 80
));
The array is the settings for the module. Note that the layout, position, status and sort order aren't included, as they're irrelevant here. I've also used special_block
as a unique key for the content, to avoid it conflicting with any other items that may need rendering
Then in your template file, you just need to use <?php echo $special_block; ?>
wherever you want the module to go
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With