dunngra Posted May 27, 2013 Share Posted May 27, 2013 Hi there, I am using Prestashop 1.5.4.1 and managed to hook the home slider to the top of pages so that I can use it all CMS pages and not just the homepage. I was wondering if there would be a way to create a different version of the slider for each page with different images? Any thoughts would be greatly appreciated. Thanks Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2013 Share Posted May 27, 2013 it's possible but only with modifications of the module core. By default this feature isn't available. Link to comment Share on other sites More sharing options...
dunngra Posted May 27, 2013 Author Share Posted May 27, 2013 Thanks vekia. Does anyone have any experience of how to customise the module for this? Thanks Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2013 Share Posted May 27, 2013 in the homeslider.tpl file you've got {foreach} loop you can add there simple if condition which will check the CMS page ID & slide ID {if $slide.id_homeslider_slides=="ID SLIDE TO DISPLAY" && Tools::getValue('id_cms')=="ID PAGE"} DISPLAY SLIDE {/if} you can add as many if conditions as you want Link to comment Share on other sites More sharing options...
dunngra Posted May 27, 2013 Author Share Posted May 27, 2013 Awesome - thanks so much for you help Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2013 Share Posted May 27, 2013 let me know if you've got troubles or if it works as you expect Link to comment Share on other sites More sharing options...
dunngra Posted May 27, 2013 Author Share Posted May 27, 2013 let me know if you've got troubles or if it works as you expect Quick question - how do I identify the slide ID - is is just the number of the image that I've uploaded? Thanks Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2013 Share Posted May 27, 2013 ID of the slider is here: Link to comment Share on other sites More sharing options...
dunngra Posted May 27, 2013 Author Share Posted May 27, 2013 perfect, thanks Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2013 Share Posted May 27, 2013 of course use only number, without hash (#) sign Link to comment Share on other sites More sharing options...
dunngra Posted May 27, 2013 Author Share Posted May 27, 2013 Lol, thanks Any time I make a change to the homeslider.tpl my site becomes unresponsive for some reason so I 'm struggling to test out the changes. I have tested in Chrome IE and Firefox. In Chrome and IE the page just hangs and goes nowhere and in Firefox I get the following error message: Warning: Unresponsive Script A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://nourishedbynature.co.uk/js/jquery/jquery-1.7.2.min.js:2 Link to comment Share on other sites More sharing options...
dunngra Posted May 27, 2013 Author Share Posted May 27, 2013 I'm at a complete loss with this Any time I try to edit the homeslider.tpl with this change then reload the page I'm getting the dreaded white screen. Not sure why as I've been able to update other .tpl files and I have the force compile set to on and the cache turned off. Nor sure what else could be the problem. Any ideas? Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2013 Share Posted May 27, 2013 i suppose that this might be the parse error in the smarty template file. You should turn error reporting - then if some error apear - please paste it here Link to comment Share on other sites More sharing options...
dunngra Posted May 28, 2013 Author Share Posted May 28, 2013 Hi, There doesn't seem to be any error messages showing. In firefox it says that the jquery-1.7.2.min.js:2 script isn't responding and when I kill this the page shows without the homeslider. Not sure why this would happen. I have implemented this to make the slider show on every page but don't think this should cause a problem? : http://mypresta.eu/en/art/tips-and-tricks/how-to-move-image-slider-module-from-home-to-top-in-prestashop.html Link to comment Share on other sites More sharing options...
vekia Posted May 28, 2013 Share Posted May 28, 2013 nope, with this modification everything should work fine. Im convinced that this might be the parse error in the template are you sure that you use correct code for {if} conditions? can you paste your code here? Link to comment Share on other sites More sharing options...
dunngra Posted May 28, 2013 Author Share Posted May 28, 2013 Hi there, Not sure if I was implementing it correctly but I was trying to test it first of all with something like: <ul id="homeslider"> {foreach from=$homeslider_slides item=slide} {if $slide.active && $slide.id_homeslider_slides=="1" && Tools::getValue('id_cms')=="6"} <li> <a href="{$slide.url|escape:'htmlall':'UTF-8'}" title="{$slide.description|escape:'htmlall':'UTF-8'}"> <img src="{$smarty.const._MODULE_DIR_}/homeslider/images/{$slide.image|escape:'htmlall':'UTF-8'}" alt="{$slide.legend|escape:'htmlall':'UTF-8'}" height="{$homeslider.height|intval}" width="{$homeslider.width|intval}" /> </a> </li> {/if} {/foreach} </ul> Link to comment Share on other sites More sharing options...
Recommended Posts