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

head.tpl - posting different image on index than other pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-04-2003, 12:07 PM
  hzellers's Avatar 
hzellers hzellers is offline
 

Senior Member
  
Join Date: Mar 2003
Location: Cortland, New York
Posts: 106
 

Default head.tpl - posting different image on index than other pages

Hi there!

I have 2 images in the head.tpl area.

I'm looking for the proper if/else code (if that's what I need) to have one of the images change if the person is on the home page vs. other pages in the site.

So, if on the /customer/home.php page Version A would appear. But, if on any other page, Version B would appear. Both images are the exact same size, I just need it call Version A when /customer/home.php is up and call Version B when any other page is up.

Thanks to all geniuses!

Heather
__________________
Thank you!
Reply With Quote
  #2  
Old 06-04-2003, 01:12 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

try something like this

Code:
{if $main eq "catalog" and $current_category.category eq ""} [img]{$ImagesDir}home_pic.jpg[/img] {else} [img]{$ImagesDir}other_pic.jpg[/img] {/if}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 06-04-2003, 01:54 PM
  hzellers's Avatar 
hzellers hzellers is offline
 

Senior Member
  
Join Date: Mar 2003
Location: Cortland, New York
Posts: 106
 

Default

Thank you! Any idea how to get rid of a pesky gap between head.tpl and the start of each page? I can't figure it out.

Thanks again wizard!

Heather
__________________
Thank you!
Reply With Quote
  #4  
Old 06-04-2003, 01:57 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

may be a
tag in there somewhere
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 06-04-2003, 02:03 PM
  hzellers's Avatar 
hzellers hzellers is offline
 

Senior Member
  
Join Date: Mar 2003
Location: Cortland, New York
Posts: 106
 

Default

No, no BR tag. Here's my entire head.tpl:

Quote:
{* $Id: head.tpl,v 1.22.2.1 2003/02/19 13:23:08 svowl Exp $ *}
<center>
[img]{$ImagesDir}/topnav.jpg[/img]

{if $main eq "catalog" and $current_category.category eq ""}
[img]{$ImagesDir}/topnav2gif.gif[/img]
{else}
[img]{$ImagesDir}/topnav2gif.gif[/img]
{/if}

And your code worked like a charm.

Heather
__________________
Thank you!
Reply With Quote
  #6  
Old 06-04-2003, 02:10 PM
  hzellers's Avatar 
hzellers hzellers is offline
 

Senior Member
  
Join Date: Mar 2003
Location: Cortland, New York
Posts: 106
 

Default

I'm wondering if it might be somewhere in this mess (from home.tpl)

Quote:
{* $Id: home.tpl,v 1.42 2002/10/22 10:27:05 olga Exp $ *}
{ config_load file="$skin_config" }
<html>
<head>
<title>{$lng.txt_site_title}
{if $main eq "catalog"}
{if $location eq ""} {$lng.txt_subtitle_home}
{else}
{strip}
{section name=position loop=$location start=0 }
{if %position.last% eq "true"} - {$location[position].0|escape}{/if}
{/section}
{/strip}
{/if}
{elseif $main eq "product"}
{if $product.product ne ''} - {$product.product}{/if}
{elseif $main eq "help"}
{$lng.txt_subtitle_help}
{elseif $main eq "cart"}
{$lng.txt_subtitle_cart}
{elseif $main eq "checkout"}
{$lng.txt_subtitle_checkout}
{elseif $main eq "order_message"}
{$lng.txt_subtitle_thankyou}
{/if}
</title>
{ include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}">
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
{ include file="rectangle_top.tpl" }
{ include file="head.tpl" }

<table border=0 width=100% cellpadding=0 cellspacing=0 align="center">
<tr>
<td width=156 valign=top>
<center>
[img]{$ImagesDir}/dng_shop.gif[/img]
</center>
{ include file="customer/categories.tpl" }


<center>
[img]{$ImagesDir}/dng_help.gif[/img]
</center>
{ include file="help.tpl" }
</td>

<td></td>
<td valign=top>

{include file="customer/home_main.tpl"}


</td>
<td></td>

<td width=155 valign=top>
<center>
[img]{$ImagesDir}/ding_cart.gif[/img]
</center>
{ include file="customer/menu_cart.tpl" }
{if $login eq "" }
<center>
[img]{$ImagesDir}/ding_login.gif[/img]
</center>
{ include file="auth.tpl" }
{else}
{ include file="authbox.tpl" }
{/if}
<center>
[img]{$ImagesDir}/ding_news.gif[/img]
</center>
{ include file="news.tpl" }


{ include file="poweredby.tpl" }
</td>
</tr>
<tr>

<td></td>

<td></td>
<td>{ include file="copyright.tpl" }</td>
<td></td>
<td></td>
</tr>
</table>
{ include file="rectangle_bottom.tpl" }
</body>
</html>
__________________
Thank you!
Reply With Quote
  #7  
Old 06-04-2003, 04:08 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

without seeing the site itself its hard to say.

probably in head.tpl
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #8  
Old 06-06-2003, 07:42 AM
 
magnumkp magnumkp is offline
 

eXpert
  
Join Date: Apr 2003
Location: England
Posts: 304
 

Default

It might be the rectangle top.tpl, if it is not used try commenting it out. Does the gap run the full length between the head.tpl and bit underneath, or is it just above the central section? Also I've found Javascript tag can cause problems with breaks if the end tag isn't closed in the right place.
Reply With Quote
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 11:32 PM.

   

 
X-Cart forums © 2001-2020