Jump to content

Advertisement block above Featured products


Recommended Posts

Hi,

PS 1.5.1, default theme.

How can I place 3 horizontal advertisement blocks above the featured products on home page?

 

I have seen this done in many themes though with PS 1.4

 

Thanks

 

you use default advertisement block or other module?

You must transplant module to home hook, go to back office, next to modules tab, and try to transplant your module to correct hook.

Link to comment
Share on other sites

I am using default Block Advertising v0.5.

I am unable to transplant it to displayHome. It shows This module cannot be transplanted to this hook.

 

I am able to transplant it to displayHeader but it doesn't show up anywhere.

 

ok so you must edit the main php file of this module. So, open the blockadvertising.php file and add right after:

 

/**
* Returns module content
*
* @param array $params Parameters
* @return string Content
*/

 

this code:

 

function hookhome($params){
 global $smarty, $protocol_content;
 Tools::addCSS(($this->_path).'blockadvertising.css', 'all');
 $smarty->assign('image', $protocol_content.$this->adv_img);
 $smarty->assign('adv_link', $this->adv_link);
 return $this->display(__FILE__, 'blockadvertising.tpl');
}

 

save file and try to transplant now. It works properly now ! :)

Edited by vekia (see edit history)
Link to comment
Share on other sites

There is no @return string content */ in blockadvertising.php.

 

I found this right at the end of the file:

 

public function hookHeader($params)

{

$this->context->controller->addCSS($this->_path.'blockadvertising.css', 'all');

}

 

Added your code after the above and transplanted to module.

It worked.

 

However now the block is shown after featured products. How can I move it above featured products?

Also I want to show 3 different blocks with different images/links.

 

I'll have to copy paste the module folder as blockadvertising1, blockadvertising2 etc and modify code accordingly?

 

Which file do I have to edit to change the homepage centre column layout? I have hidden the right and left columns.

 

Thanks for all the help! :)

Link to comment
Share on other sites

Vekia how do I add multiple advertisement blocks and how do I move above featured products?

Can you tell me which tpl file controls frontpage layout?

Thanks!

 

hi

 

you must change the module position in modules -> position section. Find "hoome" hook there and move blockadvertising to top of the list.

 

you must edit blockadvertising.tpl file :)

 

Before any changes in tempalte files turn force compile to on (performance in advanced tab)

Link to comment
Share on other sites

  • 4 weeks later...
  • 9 months later...

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...