| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Need code help. jQuery banner to home page only. | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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.
__________________
4.7.7 Light Responsive |
|||||||
#2
|
|||||||||
|
|||||||||
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.
|
|||||||||
|
#3
|
|||||||
|
|||||||
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}
__________________
4.7.7 Light Responsive |
|||||||
#4
|
|||||||||
|
|||||||||
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:
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
|
#5
|
|||||||||
|
|||||||||
Re: Need code help. jQuery banner to home page only.
I would put it within the else/last section:
PHP Code:
|
|||||||||
|
#6
|
|||||||
|
|||||||
Re: Need code help. jQuery banner to home page only.
That fixed it. Thank you Sergey. Thank you Cherie.
__________________
4.7.7 Light Responsive |
|||||||
|
|||
X-Cart forums © 2001-2020
|