d.crysty23 Posted February 13, 2014 Share Posted February 13, 2014 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 More sharing options...
vekia Posted February 13, 2014 Share Posted February 13, 2014 {if $page_name == "index"} instead of {if $page_name == index} in addition, make sure that your theme doesn't override module template file, if so - you have to append changes there instead of in original file Link to comment Share on other sites More sharing options...
d.crysty23 Posted February 13, 2014 Author Share Posted February 13, 2014 And how do I check that? What I can say is that I've added your modified code now and the module disappeared from all pages.. it's nowhere to be found at the moment Link to comment Share on other sites More sharing options...
vekia Posted February 13, 2014 Share Posted February 13, 2014 can you show full code of your template file And how do I check that? go to /themes/YOUR_THEME/modules/homeslider/ if there exists file homeslider.tpl - you have to modify this file (it's overrided by your theme) Link to comment Share on other sites More sharing options...
d.crysty23 Posted February 13, 2014 Author Share Posted February 13, 2014 {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 More sharing options...
Recommended Posts