Jump to content

[SOLVED] Home slider appears in all pages


Recommended Posts

what you exactly tried to do with "permissions" ?

 

if i were you, i will use "exceptions" to dispaly page everywhere instead of "index" (modules > modules Positions > search for displayTop modules list > click edit near your slider module).

Link to comment
Share on other sites

what you exactly tried to do with "permissions" ?

 

if i were you, i will use "exceptions" to dispaly page everywhere instead of "index" (modules > modules Positions > search for displayTop modules list > click edit near your slider module).

Yes.. I tried this but it doesn`t work.. The slider still appears in pages set as exceptions.

Link to comment
Share on other sites

Add this code to /themes/ot_valupat/css/modules/othomeslider/bx_styles.css:

#ot_slideshow {
    display: none;
}
#index #ot_slideshow {
    display: block;
}

It's not perfect solution because slider is still loaded on every page, what makes page load slighlty longer, but it makes slider visible only on homepage.

Link to comment
Share on other sites

what theme you use? default one?

 

open module .tpl file (homeslider.tpl), change code to:

{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="{$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>
{/if}
<!-- /Module HomeSlider -->
{/if}
Link to comment
Share on other sites

Add this code to /themes/ot_valupat/css/modules/othomeslider/bx_styles.css:

#ot_slideshow {
    display: none;
}
#index #ot_slideshow {
    display: block;
}

It's not perfect solution because slider is still loaded on every page, what makes page load slighlty longer, but it makes slider visible only on homepage.

Thank you! That is a good solution at least for the moment. Now it looks ok. 

The slider seems to be hooked in pages header instead of homepage content. In BO I can`t transplant it.

Link to comment
Share on other sites

 

what theme you use? default one?

 

open module .tpl file (homeslider.tpl), change code to:

{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="{$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>
{/if}
<!-- /Module HomeSlider -->
{/if}

Thank you for the quick replay. Is not the default one. Is OT Valupat and the module is OT Homeslider.

Link to comment
Share on other sites

it's always worth to write detailed information about your module ;)

 

anyway, add this if condition:

 

{if $page_name=="index"}

CODE OF TPL FILE HERE

{/if}

 

to your module template file.

Thank`s again for your help! Seems to work fine.

Link to comment
Share on other sites

×
×
  • Create New...