panupat Posted July 29, 2013 Share Posted July 29, 2013 (edited) Hi. If I want a module to only only show up in certain pages, is there a way I can do that without having to add all other pages to the hook's exception? If possible I would like to avoid using css display none as this block is showing quite a huge picture. Not having to load it at all would be preferable. Thanks. Edited July 29, 2013 by panupat (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 29, 2013 Share Posted July 29, 2013 there is no other way (in back end) to achieve what you want. Only after modificaiton: http://www.prestashop.com/forums/topic/254063-ps-15-improvement-modules-positions-exceptions/page__p__1264885?do=findComment&comment=1264885 (it's easy to define exceptions with this modification) you can also change the module .tpl file or in the .php file - add the {if} conditions to check browsed page then display hook, or not Link to comment Share on other sites More sharing options...
panupat Posted July 30, 2013 Author Share Posted July 30, 2013 Thanks. Can you give me example of the {if} statement please? If I want to check if the page is the homepage, what would the code look like? Link to comment Share on other sites More sharing options...
vekia Posted July 30, 2013 Share Posted July 30, 2013 for smarty: {if $page_name=='index'} SMARTY TEMPLATE FILE CONTENT HERE {/if} for php: global $smarty; if ($smarty->tpl_vars['page_name']->value=='index'){ hook contents here } Link to comment Share on other sites More sharing options...
rfox2013 Posted October 24, 2013 Share Posted October 24, 2013 Prestashop 1.5.6 Feeling really stupid on this one. Got a module that is hooked into displayHeader, but index is listed as a file exception and I want it removed so I can display it. It's on all the pages, but I can't get it on the index page. I want to Remove the exception, not add one, but the form list seems to be fixed. just want to remove index from the exceptions list. Thanks Link to comment Share on other sites More sharing options...
vekia Posted October 24, 2013 Share Posted October 24, 2013 if you go to modules > positions and click "edit" button near your module (on displayHeader modules list) you can define exceptions there, just remove index this should work. Link to comment Share on other sites More sharing options...
rfox2013 Posted October 24, 2013 Share Posted October 24, 2013 Thats where I feel really stupid, there doesn't seem to be any button or function to remove it from the list. Just a list inside an un-editable list box. You can select it, but it only pooulates the top field. thanks again Link to comment Share on other sites More sharing options...
rfox2013 Posted October 26, 2013 Share Posted October 26, 2013 I know, newbie. Here's my problem exactly. Got a Theme Manager module that is hooked into displayHeader. It shows up on every page except the home page (index) Doesn't matter what I do, select index from exceptions list, etc. I just want it on the home page also. Is there a db table where I can make a relationship for this module where I can somehow allow displayHeader to show it on the index page in addition to all other pages? Module name lcsthemestyle (Theme Manager) Hooked into displayHeader thanks Link to comment Share on other sites More sharing options...
vekia Posted October 26, 2013 Share Posted October 26, 2013 Doesn't matter what I do, select index from exceptions list, etc. if you select index from exceptions list - it mean that module will not appear there. Link to comment Share on other sites More sharing options...
rfox2013 Posted October 26, 2013 Share Posted October 26, 2013 Thanks venkia, I understand that, there is something in the module that is not allowing it to populate the correct javaascript in the headers of the index page, as it appears in every other page, regardless of whether index is in the list or not. I appreaciate your comments, I'll just keep digging. 1 Link to comment Share on other sites More sharing options...
PrestaToys Posted December 16, 2013 Share Posted December 16, 2013 I am having this issue as the Store Locator Block does not appear on my category and sub-category pages, but I want it to. I go to edit the dsplayLeftColumn hook and it lists "category" in the exceptions list. I hope/think the solution is to remove "category" from that exception list, but there seems to be no way to remove these exceptions, just add them. Anyone know how to remove one of these exceptions?. Link to comment Share on other sites More sharing options...
PrestaToys Posted December 16, 2013 Share Posted December 16, 2013 Finally fixed it, I had to disable the Store Locator Block Module, then Uninstall it, then Install it again, then Configure it. It now appears on the Category pages. All good! Link to comment Share on other sites More sharing options...
Recommended Posts