Adding Web Page and Email Links


We'll start by presenting some of the simplest elements you can add to your listingHTML web page and email links.

Special Effect 9.1. Text Link to More Information in a New Window

eBay has specific rules as to what you can and can't link to from your auction listings. In general, you can link to other eBay pages, and to non-eBay pages that present additional information pertinent to your specific auction. You can't link to pages that encourage non-eBay sales.

To that end, you should be very careful when you choose which pages to link to. This special element adds a text link to an external web page, as shown in Figure 9.1, and opens that web page in a new windowso your eBay auction remains open even while the external page is being read.

Figure 9.1. A text link to more information on another web page; when visitors click the link, the new page appears in a separate window.


To force the linked-to page to open in a new window, we use a special attribute within the <a href> tag. This attribute is target="_blank"; the "_blank" part is what forces a new window to open.

The entire code for this element should be inserted into your template where you want the link to appear. You can change the text-align property within the <p> tag to change the center alignment; you can also delete the font-weight property to make the link appear like the surrounding body text. Obviously, you should replace URL with the full URL (including the "http://") of the page you want to link to.

<p style="font-weight: bold; text-align: center"> <a href="URL" target="_blank">Click for more information</a> </p>


Special Effect 9.2. Button Link to More Information

Everybody uses standard text links. How about a link that appears as a button in your listinglike the one in Figure 9.2? When visitors click the button, the linked-to page appears.

Figure 9.2. Click the button to link to a page of more information.


This effect creates a very short form with a browser-generated button; you don't need a separate graphics file to create the button. To create this effect, we use a bit of JavaScript code that specifies what happens when the button is clickedin this instance, a goToURL function. Just insert the following code where you want the button to appear in your listing. (You can also change the text on the button itself by editing the "Click for More Info" text.)

<script language="JavaScript"> <!-- Begin function goToURL(){window.location = "URL";} // End --> </script> <center> <form> <input type=button value="Click for More Info" onClick="goToURL()"> </form> </center>


Special Effect 9.3. Click-to-Send Email Link

Another popular use of HTML links is to send email messages. This effect puts a link in your listing that, when it's clicked by a potential buyer, opens a new email message addressed to you. Visitors can use this link, like the one shown in Figure 9.3, to ask questions of you during the auction.

Figure 9.3. A simple click-to-send email link; clicking the link opens a new blank email message.


This is a simple click-to-send email link, and the code is correspondingly simple. Just insert the code where you want the link to appearand feel free to format the link text (or the <p> tag, using CSS styles) as you like. Remember to replace EMAILADDRESS with your full email address, in the form of name@domain.com.

<p style="font-weight: bold; text-align: center"> <a href="mailto:EMAILADDRESS"> Click here to email me with any questions </a> </p>


Special Effect 9.4. Click-to-Send Email Link with Auction Number in the Subject

This effect is a bit more complicated, but also much more useful. The only problem with the standard click-to-send email link is that it doesn't reference any particular auction; it's likely that you'll receive messages from potential buyers where you can't figure out which of your many auctions they're asking about. This effect, shown in Figure 9.4, fixes that problem by adding the number of the auction to the subject line of the email.

Figure 9.4. A click-to-send email link that puts the auction number in the subject line of the email message.


To make this apparently simple change requires quite a bit of extra codeagain, using the programming capabilities of JavaScript. In the document.write line, you need to replace EMAILADDRESS with your own email address as part of the long mailto: line, with no spaces before or after the address. Naturally, you can change the "Click here to email me with any questions" line with your own text; just insert this entire block of code where you want the click-to-send link to appear.

<script type=text/javascript> var itemnumber = ''; var querystring = document["location"].toString(); if(querystring){   myArray = querystring.split(/&/);    x = 0;    while (myArray[x]){     values = myArray[x].split(/=/);     if(values[0]=="item"){       itemnumber = values[1];     }     x = x+1;    }   }  document.write ("<a href='mailto:EMAILADDRESS?subject= eBay%20Item%20"+itemnumber+"'>"); </script> <p style="font-weight: bold; text-align: center"> Click here to email me with any questions </p> </a>





eBay Auction Templates Starter Kit
eBay Auction Templates Starter Kit
ISBN: 0789735636
EAN: 2147483647
Year: 2007
Pages: 101

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net