Jump to content

Using different slider images on each page


Recommended Posts

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

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

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

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

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

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

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

×
×
  • Create New...