X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   head.tpl - posting different image on index than other pages (https://forum.x-cart.com/showthread.php?t=3023)

hzellers 06-04-2003 12:07 PM

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

shan 06-04-2003 01:12 PM

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}


hzellers 06-04-2003 01:54 PM

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

shan 06-04-2003 01:57 PM

may be a
tag in there somewhere

hzellers 06-04-2003 02:03 PM

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

hzellers 06-04-2003 02:10 PM

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>


shan 06-04-2003 04:08 PM

without seeing the site itself its hard to say.

probably in head.tpl

magnumkp 06-06-2003 07:42 AM

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.


All times are GMT -8. The time now is 10:15 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.