Jump to content

[SOLVED] Home page image slider module not working


Recommended Posts

  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

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

  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

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

  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

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

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

  • 4 weeks later...

 

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...

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...