themechancistoolbox Posted July 31, 2014 Share Posted July 31, 2014 I'm new to Prestashop but am figuring it out as I go along. One thing I can't figure out is why the image slider isn't working. I'm using the online tool store template from Template Monster, and the slider in the online demo version works perfect: http://www.templatemonster.com/demo/49140.html I've deleted and reinstalled the module but it still doesn't work. It shows the first image, which is the default one, but it never changes nor are there any buttons to manually use it. I've checked every setting I can think of and have spent hours trying to figure it out. Here's a link to my page: www.themechanicstoolbox.com I'm sure I've done something wrong, just can't figure it out. The module is version 1.3.9 - Thanks Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 Your site is not loading javascripts. Check if you have this code in header.tpl: {if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)} {$js_def} {foreach from=$js_files item=js_uri} <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script> {/foreach} {/if} Link to comment Share on other sites More sharing options...
vekia Posted July 31, 2014 Share Posted July 31, 2014 hello what prestashop version you use? Link to comment Share on other sites More sharing options...
themechancistoolbox Posted July 31, 2014 Author Share Posted July 31, 2014 Thanks for the quick responses. I'm using prestashop version 1.6.0.8. Here's all header.tpl has: {if isset($homeslider)} {addJsDef homeslider_loop=$homeslider.loop} {addJsDef homeslider_width=$homeslider.width} {addJsDef homeslider_speed=$homeslider.speed} {addJsDef homeslider_pause=$homeslider.pause}{/if} Here's what homeslider.tpl looks like: {if $page_name =='index'} <!-- Module HomeSlider --> {if isset($homeslider_slides)} <div id="homepage-slider"> {if isset($homeslider_slides.0) && isset($homeslider_slides.0.sizes.1)}{capture name='height'}{$homeslider_slides.0.sizes.1}{/capture}{/if} <ul id="homeslider"{if isset($smarty.capture.height) && $smarty.capture.height} style="max-height:{$smarty.capture.height}px;"{/if}> {foreach from=$homeslider_slides item=slide} {if $slide.active} <li class="homeslider-container"> <a href="{$slide.url|escape:'html':'UTF-8'}" title="{$slide.legend|escape:'html':'UTF-8'}"> <img src="{$link->getMediaLink("`$smarty.const._MODULE_DIR_`homeslider/images/`$slide.image|escape:'htmlall':'UTF-8'`")}"{if isset($slide.size) && $slide.size} {$slide.size}{else} width="100%" height="100%"{/if} alt="{$slide.legend|escape:'htmlall':'UTF-8'}" /> </a> {if isset($slide.description) && trim($slide.description) != ''} <div class="homeslider-description">{$slide.description}</div> {/if} </li> {/if} {/foreach} </ul> <div id="bx-pager-thumb"> {foreach from=$homeslider_slides item=slides name=slides} {if $slide.active} <a data-slide-index="{$smarty.foreach.slides.iteration - 1}" href=""><img src="{$link->getMediaLink("`$smarty.const._MODULE_DIR_`homeslider/images/`$slides.image|escape:'htmlall':'UTF-8'`")}" alt="" /></a> {/if} {/foreach} </div> </div> {/if} <!-- /Module HomeSlider -->{/if} Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 Try to add above code to header.tpl. It was introduced in 1.6.0.7 and your theme was made for 1.6.0.6 so that is probably your problem. Link to comment Share on other sites More sharing options...
themechancistoolbox Posted July 31, 2014 Author Share Posted July 31, 2014 I've added the code listed above to header.tpl so now it looks like this: {if isset($homeslider)} {addJsDef homeslider_loop=$homeslider.loop} {addJsDef homeslider_width=$homeslider.width} {addJsDef homeslider_speed=$homeslider.speed} {addJsDef homeslider_pause=$homeslider.pause} {/if} {if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)} {$js_def} {foreach from=$js_files item=js_uri} <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script> {/foreach} {/if} I cleared my browser cache and refreshed the page but it still has the same problem. Other ideas? Thanks. Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 Try to recompile template and clear PS cache in BO > Advanced parameters > Performance. Link to comment Share on other sites More sharing options...
themechancistoolbox Posted July 31, 2014 Author Share Posted July 31, 2014 I cleared the cache using the "clear cache" button under Advanced parameters > Performance, then set template compilation to "force compilation" and saved the changes. I cleared my browser cache but still no luck. Would it be easier to just buy one of the inexpensive slider modules that are available? Thanks again. Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 There's no need to buy slider. It won't work either. You have problem with your theme. It doesn't load any javascript file and you should have around 20 of them so there's many more things on your site not working. For example if you put something in cart, it should drop down on mouse over but it doesn't work either... Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 Can you post your theme header.tpl here. Link to comment Share on other sites More sharing options...
themechancistoolbox Posted July 31, 2014 Author Share Posted July 31, 2014 (edited) That didn't work, it's under this link: http://www.themechanicstoolbox.com/temp/code Edited July 31, 2014 by themechancistoolbox (see edit history) Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 I can't see it that way. Paste code from header.tpl here. Link to comment Share on other sites More sharing options...
themechancistoolbox Posted July 31, 2014 Author Share Posted July 31, 2014 I edited the post above with a link to the code, apparently it's too long to post here. Link to comment Share on other sites More sharing options...
dioniz Posted July 31, 2014 Share Posted July 31, 2014 Ok i don't see that code i gave you in this file. Add it just after: {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" /> {/foreach} {/if} so it looks like this: {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" /> {/foreach} {/if} {if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)} {$js_def} {foreach from=$js_files item=js_uri} <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script> {/foreach} {/if} Link to comment Share on other sites More sharing options...
themechancistoolbox Posted August 3, 2014 Author Share Posted August 3, 2014 That took care of it, thank you. I misunderstood you the first time and added the new code to header.tpl for the homeslider module, not the theme itself. Thanks again for your help, I really appreciate it, I never would have figured that out. 1 Link to comment Share on other sites More sharing options...
dioniz Posted August 3, 2014 Share Posted August 3, 2014 You are welcome I'll mark this thread solved now. Link to comment Share on other sites More sharing options...
eranyil Posted August 27, 2014 Share Posted August 27, 2014 On 7/31/2014 at 10:21 PM, dioniz said: Ok i don't see that code i gave you in this file. Add it just after: {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" /> {/foreach} {/if} so it looks like this: {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" /> {/foreach} {/if} {if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)} {$js_def} {foreach from=$js_files item=js_uri} <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script> {/foreach} {/if} Thanks a lot... 1 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