Jump to content

How to display the slider module only on the homepage?


Recommended Posts

I'm bothered by the fact that the "slider" module is displayed on all pages when I want it to be displayed only on the homepage. I've added the codeline below but with no result. I did the same thing for the "block_category" module and it worked there. So I don't really know what's causing the problem

{if $page_name == index}

homeslider.tpl content


{/if}

Thanks in advance!

Link to comment
Share on other sites


{if $page_name == index}

<!-- Module HomeSlider -->

 

{if isset($homeslider)}

<script type="text/javascript">

{if isset($homeslider_slides) && $homeslider_slides|@count > 1}

{if $homeslider.loop == 1}

var homeslider_loop = true;

{else}

var homeslider_loop = false;

{/if}

{else}

var homeslider_loop = false;

{/if}

var homeslider_speed = {$homeslider.speed};

var homeslider_pause = {$homeslider.pause};

</script>

{/if}

{if isset($homeslider_slides)}

<ul id="homeslider">

{foreach from=$homeslider_slides item=slide}

{if $slide.active}

<li>

<a href="{$slide.url|escape:'htmlall':'UTF-8'}" title="{$slide.description|escape:'htmlall':'UTF-8'}">

<img src="{$link->getMediaLink("`$module_dir`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>

{/if}

 

<!-- /Module HomeSlider -->

{/if}

Link to comment
Share on other sites

×
×
  • Create New...