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

adding link to image called via .tpl file--- not working

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-09-2003, 07:10 AM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default adding link to image called via .tpl file--- not working

Hi there,

I am trying to make an image a hyperlink but it is not working. This is an image which will be below featured products image. If you see below featured products image default is shown a hyperlink text "see details" and I am trying to replace that with an image having heading see details.

(I have noticed if we directly hyperlink to image it gives a thick blue outline which is not desired.)

I have introduced this image in a next-row after featured products image
in the same table. Featured product image is also a hyperlink but its form is like this :

<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{in clude file="product_thumbnail.tpl" productid=$products[product].productid image_x=140 product=$products[product].product}</a>

Here the called file is made a hyperlink and it is working. But when i do the same thing with "see details" image it is not working. I want the same hyperlink for "see details" image as above.

I tried it two ways

1. i created a file "see-details.tpl" and put the coding there as :

[img]{$ImagesDir}/see-details.gif[/img]

In "products.tpl" file i hyperlinked this .tpl file like this:

{include file="see-details.tpl"}

--------------- output : Not Working

2. i changed the coding in see-details file as :

[img]{$ImagesDir}/b_see-details.gif[/img]

and simply called it in products.tpl file

--------------- output : Not Working

see http://www.templatearena.com/xcart/customer

Please help me resolve this problem. I would be Greatful to you!!

Thanks
Bye
__________________
Rohit Sharma
Reply With Quote
  #2  
Old 04-09-2003, 09:57 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Did this but slightly differently to you:

first created a new button template: showdetail.tpl in skin1/buttons/

Code:
[img]{$ImagesDir}/details.gif[/img]

then in customer/main/products.tpl

have an include such as:

<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{in clude
file="buttons/showdetail.tpl"}</a>

hth
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 04-09-2003, 11:42 PM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default RE: adding link to image called via .tpl file--- not working

Hi again,

I am sorry buddy! But its true that I tried your suggestion and unluckly its not working still. Check it out at http://www.templatearena.com/xcart/customer

You did the same thing as i did in my no.1 effort except that you changed the path. I don't think if changing path matters untill you mention it right when refering to that file? Is it not?

Please try once more and come up with your fruitful efforts. I would be greatful to you!!

Ok, Bye. Keep up the good effort.

chau
__________________
Rohit Sharma
Reply With Quote
  #4  
Old 04-09-2003, 11:59 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

can you post the code from your products.tpl file?
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 04-14-2003, 04:05 AM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default RE2:adding link to image called via .tpl file--- not working

Hi Again,

I am sorry for the delay as Internet connection at my end was not working...Please don't mind

Here is the code for the "customer/main/products.tpl" file at my end. I have bolded those lines of code here for seedetails.tpl. See below:
--------------------------------------------------------------------------------------

{* $Id: products.tpl,v 1.21.2.2 2003/03/11 10:49:14 svowl Exp $ *}
{section name=product loop=$products}


<table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="153" valign="top" align="center">
<table width="153" border="0" cellspacing="0" cellpadding="0" name="featuredimage-table">
<tr>
<td colspan="3" height="25">[img]{$ImagesDir}/img-featured-1.gif[/img]</td>
</tr>
<tr>
<td width="3" background="{$ImagesDir}/img-featured-2.gif">[img]{$ImagesDir}/spacer.gif[/img]</td>
<td width="147" align="center" valign="top">
<table align="center"name="mainfeatured-box" width="140" border="0" cellspacing="0" cellpadding="0">
<tr><td height="10">[img]{$ImagesDir}/spacer.gif[/img]</td></tr><tr>
<td><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{in clude file="product_thumbnail.tpl" productid=$products[product].productid image_x=140 product=$products[product].product}</a></td>
</tr>
<tr><td height="10">[img]{$ImagesDir}/spacer.gif[/img]</td></tr>
</table>


</td>
<td width="3" background="{$ImagesDir}/img-featured-2.gif">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
<tr valign="top" align="center">
<td colspan="3><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{in clude
file="buttons/seedetails.tpl"}</a>
</td>

</tr>
</table>
</td>
<td width="7"></td>
<td width="240">


<table name="details" width="240" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#666666">
<td colspan="3" height="1">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
<tr>
<td bgcolor="#666666" width="1">[img]{$ImagesDir}/spacer.gif[/img]</td>
<td valign="top" align="center" width="238">
<table width="230" border="0" cellspacing="0" cellpadding="0" name="pr-name" bgcolor="#F8F8F8">
<tr>
<td bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td height="25">{$products[product].product}</font></td>
</tr>
<tr>
<td height="3" bgcolor="#FFFFFF">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
</table>
<table width="230" border="0" cellspacing="0" cellpadding="0" name="pr-details" bgcolor="#DDDDDD">
<tr>
<td width="5"></td>
<td width="220"><font size=1>

{$products[product].descr|truncate:300:"...":true}

</font></td>
<td width="5"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="3" colspan="3">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
</table>
<table width="230" border="0" cellspacing="0" cellpadding="0" name="pr-price" bgcolor="#F8F8F8">
<tr>
<td width="5"></td>
<td width="220" height="20">{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].discount ne 0}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>
{math equation="price/(1-(discount/100))" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted}
</s></font>

{/if}
<font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if}{if $config.General.use_vat eq "Y"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
{else}
<font class=ProductPrice>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}</td>
<td width="5"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="3"></td>
</tr>
</table>
</td>
<td bgcolor="#666666" width="1">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
<tr bgcolor="#666666">
<td colspan="3" height="1">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
</table>
</td>
</tr>
</table>
{/section}

--------------------------------------------------------------------------------------

Here is the code for "/buttons/seedetails.tpl"

--------------------------------------------------------------------------------------

[img]{$ImagesDir}/b_see-details.gif[/img]


--------------------------------------------------------------------------------------

Also, can you tell me how to add affiliate section in our home page.

Thankyou
Bye
__________________
Rohit Sharma
Reply With Quote
  #6  
Old 04-15-2003, 10:28 PM
 
Alan Alan is offline
 

Advanced Member
  
Join Date: Feb 2003
Posts: 83
 

Default

Hi Rohit,

Quote:
(I have noticed if we directly hyperlink to image it gives a thick blue outline which is not desired.)

Add a border=0 to your href tags, for example:

[img]{$ImagesDir}/xxxx.gif[/img]
__________________
Best Regards!
Alan
Search is my friend
Reply With Quote
  #7  
Old 04-15-2003, 11:37 PM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default Thanks Alan

Hi Alan,

Thanks for the suggestion!

I have finally made it !!! yeappy

But the problem was at my end. I had forgot to close the colspan with double quotes inside <TD> tag just before the start of <a href=..... A very silly thing not noticed.

One thing i did according to you but the border was still coming but when i put the border inside img tag equal to "0" it worked.

Anyways your entry has proved lucky for me.

Best Regards ,
__________________
Rohit Sharma
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 09:47 AM.

   

 
X-Cart forums © 2001-2020