Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Want to show different banner on Home page and other pages.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-02-2013, 09:16 PM
  Soft-Reseller.com's Avatar 
Soft-Reseller.com Soft-Reseller.com is offline
 

Advanced Member
  
Join Date: Jul 2009
Posts: 68
 

Default Want to show different banner on Home page and other pages.

I want to show my own banner on Home page and Google banners on all other pages.

I know it will require an if condition and a veriable to catch link. I am giving down an idea but if someone can give me exact code needed.


variable = a
a = get current link
if ( a = homepage or a = home.php )
{ show my own banner (My HTML Code)}
else
{ show google banner (Google Adsense Code)}


Here I use or in if condition because when you simply open the domain
example
http://www.soft-reseller.com
you will not find any file name in the end and usually it is index.html but what xcart uses I dont know.


Regards
Reply With Quote
  #2  
Old 06-03-2013, 03:37 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default Re: Want to show different banner on Home page and other pages.

{if $main eq "catalog" and $current_category.category eq ""}
{ HOME PAGE show my own banner (My HTML Code)}
{else}
{ ALL OTHER PAGES show google banner (Google Adsense Code)}
{/if}
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #3  
Old 06-03-2013, 05:07 AM
  Soft-Reseller.com's Avatar 
Soft-Reseller.com Soft-Reseller.com is offline
 

Advanced Member
  
Join Date: Jul 2009
Posts: 68
 

Default Re: Want to show different banner on Home page and other pages.

Quote:
Originally Posted by pauldodman
{if $main eq "catalog" and $current_category.category eq ""}
{ HOME PAGE show my own banner (My HTML Code)}
{else}
{ ALL OTHER PAGES show google banner (Google Adsense Code)}
{/if}

Hello

Thanks Pauldodman you understand what I want and we have done the job and got the results we want.
We put the code

{if $main eq "catalog" and $current_category.category eq ""}
{include file="addons/banners/col/banner_1.tpl"}
{else}
{include file="addons/banners/col/google_banner.tpl"}
{/if}

Can see on our site
http://www.soft-reseller.com

Thanks again and regards
Reply With Quote

The following user thanks Soft-Reseller.com for this useful post:
dtgmap (07-12-2013)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:25 PM.

   

 
X-Cart forums © 2001-2020