Jump to content

[Solved] Module in more than 1 place


Recommended Posts

Yes and no. Certain modules can't be hooked into certain places because the haven't been designed that way.

But if a module can be hooked into, say, "left column blocks" and "product footer" then it can also appear on those places at the same time.

 

Just play around with the transplant feature (Modules > Positions) and see how it goes :)

Link to comment
Share on other sites

Yes, definitely. The whole procedure is actually quite simple. For example, take a look at modules/blockspecials.php

 

Find this:

function hookLeftColumn($params)
{
	return $this->hookRightColumn($params);
}

 

And after that, add this:

 

    function hookHome($params)
    {
	global $smarty;

	if ($special = Product::getRandomSpecial(intval($params['cookie']->id_lang)))
		$smarty->assign(array(
		'special' => $special,
		'oldPrice' => number_format($special['price'] + $special['reduction'], 2, '.', '')
));
	return $this->display(__FILE__, 'blockspecials-home.tpl');
}

 

Now just make a copy of modules/blockspecials/blockspecials.tpl and name it blockspecials-home.tpl.

That gives you individual control over the version shown on the Home block.

 

Link to comment
Share on other sites

Cool! Thanks man! Btw, have another , do you know how to not display a certain block/module on a specific page?

 

Say the Cart Block, it appears on the home page, but i don't want to appear it on the login page or something, where will I control that?

 

Thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...