![]() |
Need code help. jQuery banner to home page only.
I installed a third-party jquery banner but it appears on all pages. I need it to appear on the home page only. I believe I need to add an 'if' statement to /light_responsive/customer/home.tpl. The div class should be wrapped with a smarty snippet:
{if $main eq "catalog" and $current_category.category eq ""}I don't know what to code to enter between the {if ...} and {/if} statements. Any help is much appreciated. |
Re: Need code help. jQuery banner to home page only.
Your code looks good. Add the the banner code in between. However, you might want to just put it in welcome.tpl or home_page_banner.tpl without the need for the if statement.
|
Re: Need code help. jQuery banner to home page only.
Thank you Cherie. That does seem to make sense. Any chance you could point me to the correct spot to insert my banner code?
/light_responsive/customer/main/home_page_banner.tpl: *} {if $active_modules.Banner_System and $top_banners ne ''} {include file="modules/Banner_System/banner_rotator.tpl" banners=$top_banners banner_location='T'} {elseif $active_modules.Demo_Mode and $active_modules.Banner_System} {include file="modules/Demo_Mode/banners.tpl"} {else} <div class="welcome-img"> <a href="http://www.x-cart.com" target="_blank"><img src="{$AltImagesDir}/custom/welcome_picture.jpg" alt="X-Cart" title="" /></a> </div> {/if} |
Re: Need code help. jQuery banner to home page only.
As I can see, the banner code begins with these lines:
Quote:
and ends with these lines: Quote:
So, if you need the banners to appear on the home page only, your code should be wrapped with the {if} ... {/if} smarty snippet - see example below: Quote:
|
Re: Need code help. jQuery banner to home page only.
I would put it within the else/last section:
PHP Code:
|
Re: Need code help. jQuery banner to home page only.
That fixed it. Thank you Sergey. Thank you Cherie.
|
All times are GMT -8. The time now is 07:28 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.