swiftlemur Posted September 11, 2011 Share Posted September 11, 2011 Hi, Does anyone know how to include the blocknewsletter into a CMS page. I can get it to display including the .tpl file. However, it doesn't display like it does in the footer and the smarty variables do not appear to be available to it. It therefore doesn't show the success and error messages when you submit. It does however allow you to submit/subscribe an email address. It shows the error in the footer if the block is enabled there. Thanks in advance for any help on this. Thanks VInce Link to comment Share on other sites More sharing options...
ukmacnut Posted September 24, 2011 Share Posted September 24, 2011 Hi - Did you figure this one out? It seems in 1.3 it was not problem to have blocknewsletter in the footer. In 1.4 I wonder if it is possible? Thanks Dave Link to comment Share on other sites More sharing options...
rocky Posted September 25, 2011 Share Posted September 25, 2011 No, the newsletter block can't be placed in the footer by default. You will need to edit modules/blocknewsletter/blocknewsletter.php and add the following before the last } function hookFooter($params) { return $this->hookLeftColumn($params); } Now, when you transplant the newsletter block into the footer, it should display the same way as it does in the left column. You will need to edit themes/<your_theme>/css/modules/blocknewsletter/blocknewsletter.css to change the appearance of the newsletter block. If you need to change the HTML, you will need to copy modules/blocknewsletter/blocknewsletter.tpl to themes/<your_theme>/modules/blocknewsletter/blocknewsletter.tpl. Link to comment Share on other sites More sharing options...
bartbh Posted September 26, 2011 Share Posted September 26, 2011 Is it possible to place the newsletter block on a specific CMS page? For example when page "8" of the CMS is displayed, the newsletter block is displayed at the bottom (not the footer) of this page. Link to comment Share on other sites More sharing options...
bartbh Posted September 26, 2011 Share Posted September 26, 2011 Answer to my own question, yes it is. 1) create a new hook in the table ps_hook f.e. 'Newsletter' 2) add the newletter block to the new hook 3) edit classes/FrontController.php: self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_NEWSLETTER' => Module::hookExec('Newsletter') 4) edit themes/[your-theme]/cms.tpl {if $cms->id == 8} {$HOOK_NEWSLETTER} {/if} That works for me! 1 Link to comment Share on other sites More sharing options...
noesac Posted September 27, 2011 Share Posted September 27, 2011 nice guide Link to comment Share on other sites More sharing options...
prestainfo Posted November 1, 2011 Share Posted November 1, 2011 Answer to my own question, yes it is. 1) create a new hook in the table ps_hook f.e. 'Newsletter' 2) add the newletter block to the new hook 3) edit classes/FrontController.php: self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_NEWSLETTER' => Module::hookExec('Newsletter') 4) edit themes/[your-theme]/cms.tpl {if $cms->id == 8} {$HOOK_NEWSLETTER} {/if} That works for me! At whate line do i need to edit the front controller ? Link to comment Share on other sites More sharing options...
prestainfo Posted November 1, 2011 Share Posted November 1, 2011 If i put this in the frontcontroller.php Then i get a error code , and my shop is nog working. self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_NEWSLETTER' => Module::hookExec('Newsletter') Link to comment Share on other sites More sharing options...
prestainfo Posted November 2, 2011 Share Posted November 2, 2011 If i put this in the frontcontroller.php Then i get a error code , and my shop is nog working. self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_NEWSLETTER' => Module::hookExec('Newsletter') Anyone ? Link to comment Share on other sites More sharing options...
yebberdog Posted November 3, 2011 Share Posted November 3, 2011 I have been trying to add a gallery to a cms page for ages, thanks for the tip. For those who struggle with Hooks, I use the plugin by Ecartservices and it works everytime. Infact I no longer use hooks. Check it out at http://www.ecartservice.net/prestashop-articles/tired-of-hooks-try-a-plugin-prestashop-1-4/ 1 Link to comment Share on other sites More sharing options...
robertocommerce Posted August 22, 2013 Share Posted August 22, 2013 hi all, I made this change for prestashop 1.5.4 ... with some modification works but there is a problem : if I try to insert in new block newsletter in cms page an email, redirects me in home page..this due to the file blocknewsletter.tpl ? is probably the cause this code ? <form class="navbar-form pull-left" action="{$link->getPageLink('index')}" method="post"> please help me! Link to comment Share on other sites More sharing options...
matteo_mont Posted August 27, 2013 Share Posted August 27, 2013 Hi Robert, I'm using 1.5.4 too! Can you help me with the newsletter issue, please. I've a problem in editing the Frontcontroller.php Cheers, Matteo Link to comment Share on other sites More sharing options...
ricky11 Posted January 20, 2014 Share Posted January 20, 2014 Anyone worked this out with the updated version, can't seem to find a way in documentation or otherwise to put the newsletter block in any cms pages with its own css? Link to comment Share on other sites More sharing options...
vekia Posted January 20, 2014 Share Posted January 20, 2014 you have to attach blocknewsletter css file to cmsController, or just copy blocknewsletter css styles to main global.css file there is no other way to achieve it. Link to comment Share on other sites More sharing options...
amjo Posted July 3, 2014 Share Posted July 3, 2014 (edited) is it possible to do {if $cms->id = 3} in another module, say, the Minic Slider?... I have several CMS pages, and im trying to prevent the Minic Slider to be shown on certain CMS pages like the terms and conditions page. I heard the best way to solve this is by adding a condition. but im stuck!... {$cms->id} returns nothing for me in the front.tpl of minic slider. if there's another way to solve this as well, please inform me thanks in advance UPDATE: This helped a lot, should help those in the same situation: http://www.prestashop.com/forums/topic/266802-adding-cms-page-ids-to-class-selector-in-body-tag/?p=1332304 Edited July 3, 2014 by amjo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now