fateloso Posted April 24, 2012 Share Posted April 24, 2012 Hi. I've been trying to find a solution for this for a while but can't find an answer... 1 - What I basically need is to show the "Featured Products" module inside some CMS pages, not all (you can find an example in 1.jpg). Is this possible? If so, how can I do? 2 - One other thing I'd like to change, in "Featured Products", is the font type, size and remove bold from the first line (as seen on 2.jpg). I tried a few things but none of them worked... Thank you. Miguel Link to comment Share on other sites More sharing options...
CartExpert.net Posted April 24, 2012 Share Posted April 24, 2012 Hi, #1: You could try by adding {$HOOK_HOME} to the cms.tpl and place it in an {if} statement. The condition would be e.g. {if $cms->id == 2} Then add the 'cms.php' as an exception to the home modules you do not want to display on the cms page. This should work. #2: The style should be add to global.css line 948. It would be better if you defined a completely new style to it, as not to affect other elements. e.g.:- #featured-products_block_center h5 {font-weight: normal;} Link to comment Share on other sites More sharing options...
fateloso Posted April 24, 2012 Author Share Posted April 24, 2012 Hi CartExpert. Thanks a lot for your help. Issue #2 is solved. I ended up changing the style directly... I don't like that look so, if it got changed elsewhere, that's great As to issue #1... I got the point and I think you're heading exactly to what I'd like to apply in the site. Unfortunatelly I don't know how to do it... Can you help me write the "if" statement and tell me exacty where to put it in the tpl? This would be to aply to about 20 cms pages, with Id's like 1,2,5,8,13,25,33... (not in a ordered sequence). How can I add the "cms.php" as an exception? Thanks again. Miguel Link to comment Share on other sites More sharing options...
CartExpert.net Posted April 24, 2012 Share Posted April 24, 2012 Hi Miguel, You should know the id's of the cms pages: {if $cms->id == 1 OR $cms->id == 2 [ETC]} {$HOOK_HOME} {/if} You could add it after {$cms->content} You also need to add: self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); to the 'display' function of the CMSController.php To add an exception to a module: Back Office -> Positions -> edit the module -> put 'cms.php' in the Exceptions box. Link to comment Share on other sites More sharing options...
fateloso Posted April 25, 2012 Author Share Posted April 25, 2012 Hi CartExpress. Thanks again for your precious help. I think I did exactly what you said... cleared the cache... but for some reason is not working. This is what I did: cms.tpl <div class="rte{if $content_only} content_only{/if}"> {$cms->content} {if $cms->id == 25 OR $cms->id == 11 OR $cms->id == 22 OR $cms->id == 7} {$HOOK_HOME} {/if} </div> CMSController.php public function displayContent() { parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'cms.tpl'); self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); } Also added cms.php as a Featured Products exception. What may I have done wrong? Thank you for your time and patience. Miguel Link to comment Share on other sites More sharing options...
CartExpert.net Posted April 25, 2012 Share Posted April 25, 2012 Hi Miguel, Wrong: self::$smarty->display(_PS_THEME_DIR_.'cms.tpl'); self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); Correct: self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); self::$smarty->display(_PS_THEME_DIR_.'cms.tpl'); Link to comment Share on other sites More sharing options...
fateloso Posted April 26, 2012 Author Share Posted April 26, 2012 Hi CartExpert. Thank you. I did what you said and got something like this (see attached file). It is actually showing the content of home text editor followed by featured products. I'd like to show only the featured products and remove the home text editor content. Other issue may occur in the featured products width which is breaking each line and moving the 4th item to a new line... I believe we're almost done here Thanks again for your precious help. Miguel Link to comment Share on other sites More sharing options...
yusuf.alma Posted December 11, 2012 Share Posted December 11, 2012 (edited) Dear All, I use PS 1.5.2, so how can we do this? The content of CMSController.php is totally different. Regards, Yusuf Alma Toko Baju Muslim "Almaisyah" Edited December 11, 2012 by yusuf.alma (see edit history) Link to comment Share on other sites More sharing options...
firebrand1 Posted October 14, 2013 Share Posted October 14, 2013 ...It is actually showing the content of home text editor followed by featured products. I'd like to show only the featured products and remove the home text editor content. I too have this problem! How can we show the featured products and remove the home text content? I still want the home content to show on the homepage too. I am new to Prestashop and have noticed that simple tasks are so difficult to do. Anyone know why this is?? Link to comment Share on other sites More sharing options...
vekia Posted October 15, 2013 Share Posted October 15, 2013 go to modules and search for "editorial" module or just for "home text editor" and just disable this addon. it's easy! Link to comment Share on other sites More sharing options...
firebrand1 Posted October 15, 2013 Share Posted October 15, 2013 go to modules and search for "editorial" module or just for "home text editor" and just disable this addon. it's easy! ... I still want the home content to show on the homepage too. ... If I disable this add-on won't that disable it on the homepage too?? Link to comment Share on other sites More sharing options...
vekia Posted October 15, 2013 Share Posted October 15, 2013 hello sorry but i don't understand now, you said this: and remove the home text content? I still want the home content to show on the homepage too you said that you want to remove home text content module but you want to show it on homepage. but.... this module appears only on homepage Link to comment Share on other sites More sharing options...
firebrand1 Posted October 15, 2013 Share Posted October 15, 2013 If you refer to the beginning of this thread the original poster was asking how to display featured products on another page other than the homepage. @CartExpert.net showed us how to do this but his method displays ALL of the homepage content. We were looking to display ONLY the featured products. You suggested disabling the homepage content but this would disable it sitewide. Am I making sense here? Link to comment Share on other sites More sharing options...
firebrand1 Posted October 21, 2013 Share Posted October 21, 2013 bump Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2014 Share Posted June 6, 2014 instead of modyfication of controllers just use {hook::exec('home')} in tpl file :-) Link to comment Share on other sites More sharing options...
learning1983 Posted October 7, 2014 Share Posted October 7, 2014 Hello vekia, Can you tell me how can i do this in prestashop 1.6.0.9 i want to show all products in one cms page Link to comment Share on other sites More sharing options...
oh_prestashop Posted March 27, 2015 Share Posted March 27, 2015 I would like to pick up this topic, since I have a similar idea. I want to include several single products within a CMS page. The idea is to create a product comparison table with those products included. Does anybody know how to do this? Link to comment Share on other sites More sharing options...
Mr Rick Posted August 1, 2015 Share Posted August 1, 2015 Hi, If anyone wants to embed products within CMS page i will recommend this module. http://addons.prestashop.com/en/front-office-features-prestashop-modules/19954-products-on-cms.html Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2016 Share Posted May 2, 2016 free module cms products on cms page will solve the problem especially in prestashop 1.6.x 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