Jump to content

Hook Newsletter to a CMS page


elenichee

Recommended Posts

Hi,

 

I'm very new to Prestashop 1.5... I'm trying to figure out if it's at all possible to display the newsletter signup form on a CMS page, instead of hooking it to the footer or left column block. I would just like to display a link on the Homepage, and when the user clicks on it, he/she will be redirected to a CMS page where he/she can sign up for the newsletter.

 

Is this possible? I've tried searching the forums but the instructions doesn't seem to work for me. Any help will be greatly appreciated.. thanks.

Link to comment
Share on other sites

Hi.

 

You will need to create a new hook which is only executed on a CMS page, also you need to create the hook's function in the module and transplant the module to the new hook.

The hook function of the module should be set to verify if the user is on the CMS page, which should display the module.

 

Regards.

 

Robin.

 

The CartExpert Team

Link to comment
Share on other sites

Hi Robin,

 

I tried the tutorial you recommended but nothing seems to happen on the CMS page. I must be doing something wrong...

 

Just wondering what should I write to replace the //code to execute?

 

public function hookMyHook($params)

{

//CODE TO EXECUTE

}

 

Please help... thanks. :)

Link to comment
Share on other sites

  • 1 year later...

Hi Robin,

 

I tried the tutorial you recommended but nothing seems to happen on the CMS page. I must be doing something wrong...

 

Just wondering what should I write to replace the //code to execute?

 

public function hookMyHook($params)

{

//CODE TO EXECUTE

}

 

Please help... thanks. :)

Just add this code:

public function hookMyHook($params)
{
 return $this->hookDisplayLeftColumn($params);
}
Link to comment
Share on other sites

  • 2 weeks later...

Hi all, it is solved?

 

I create hook,and insert in cms.tpl this

{if $cms->id == 14}
 {$HOOK_displayTop2} 
{/if}

To module blocknewsletter.php this

public function hookdisplayTop2($params)
{
 return $this->hookDisplayLeftColumn($params);
}	

And here is the result

Notice: Undefined index: HOOK_displayTop2 in /data/web/virtuals/71211/virtual/www/cache/smarty/compile/ff/b1/27/ffb127dd69299a6d85c9f99a891850d2da62493f.file.cms.tpl.php on line 118

Notice: Trying to get property of non-object in /data/web/virtuals/71211/virtual/www/cache/smarty/compile/ff/b1/27/ffb127dd69299a6d85c9f99a891850d2da62493f.file.cms.tpl.php on line 118

http://obchodpetrklic.cz/content/14-prihlaseni-k-odberu-novinek

 

Any idea?

 

Edited by tozi (see edit history)
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...