|
<HTML><HEAD> |
One of the easiest ways to make the script results match your site is to copy the HTML from one of your pages, then build a table where you want the results to appear then add the variables like above.
Now that you have the page template done, you're ready to modify how the products look.
The products template specifies exactly how each product will appear within the page template. The contents of this template are automatically repeated for each product displayed on a page.
Here is a sample products template:
<TABLE Bgcolor="#FFFFFF" Border="6" Cellpadding="10" Width="100%"> <TR> <TD Valign="middle"> <A Href="%%item_url%%"><IMG Align="left" Alt= %%store%% : %%ProductName%%" Border="0" Src="%%ImageUrlSmall%%"></A> <A Href="%%item_url%%"><B>%%ProductName%%</B></A><BR> %%my_artists%%<BR> %%ReleaseDate%%<BR> </TD> <TD Align="center" Valign="middle" Width="195"> %%my_prices%% </TD> </TR> </TABLE><BR> |
The item template specifies how the item information will look when you click on an individual item from the products results page.
It utilizes the page template for the main HTML of the page.
Here is a sample item template:
<TABLE Width="100%"> <TR><TD Align="center" Colspan="3" %%my_artists%%</TD></TR> <TR><TD><BR></TD></TR> <TR> <TD Align="center" Valign="top"> <A Href="%%my_large_image_url%%"><IMG Alt="%%store%% : %%ProductName%%" Border="0" Src="%%ImageUrlMedium%%"> <BR><FONT Size="2">%%see_larger_image_text1%%</FONT></A> </TD> <TD Valign="top"> %%my_prices%%<BR> <FONT Size="-1">%%my_used%% %%my_collectible%% %%my_thirdpartynew%% %%my_refurbished%%</FONT> <BR> <B>%%availability_text1%%</B> %%Availability%%<BR> </TD> <TD Align="center" Valign="middle"> %%oneclick_button%% </TD> </TR> <TR><TD><BR></TD></TR> <TR><TD Colspan="3"> %%my_descriptors%% %%my_features%% %%my_accessories%% %%my_browse_list%% %%my_similar_products%% </TD></TR> <TR><TD><BR></TD></TR> <TR Bgcolor="#00659C"> <TD Align="center" Colspan="3"> <B><FONT Color="#FFFFFF" Face="Arial, Helvetica, sans-serif"> %%customer_reviews_text1%% </FONT></B> </TD> </TR> <TR><TD Colspan="3"> <CENTER>%%average_rating_text1%% %%my_avg_rating_display%%</CENTER><BR> %%my_comments%% </TD></TR> </TABLE></CENTER> |
There are several other templates that you can use, if you've mastered the page, product, and item templates, you'll have no problem modifying these.
If you use FrontPage or a similar program to design and manage your site, you can use it to generate a page template. You do have to make a few modifications that are fairly simple.
Make a new web page inside FrontPage with the design of your site but the content area blank (easiest way is to copy and paste a web page that has the look you want, then delete the
content). Find the spot where you would like the script content to appear and type %%products_html%%. Save this file to your desktop and name it page_1.template. It's important
to note how FrontPage writes hyperlinks and images to HTML. Since FrontPage saves all files/images to the same folder, it doesn't specify the directory, but this template will
reside in a different directory than your pages and images, so you need to modify a bit.
Open the page in a text editor (notepad is fine) and use the search feature. Search for "href" this will highlight all of the hyperlinks in your page one at a time. If it is a
hyperlink that has a full URL already, don't modify it.
By default FrontPage saves them as:
<a href="page.htm">
You simply need to specify the URL, change this to
<a href="http://www.yoursite.com/page.htm">
Same idea for your images, search for "src", and change
<img src="image.jpg">
To:
<img src="http://www.yoursite.com/image.jpg">
If you use background images anywhere in your site, search for "background" and change:
background="background.jpg"
To:
background="http://www.yoursite.com/background.jpg"
As soon as your done, save the file, then FTP it to the same folder that the script resides in (/cgi-bin/amazon/)
To modify the results that the script produces, you can specify it in the URL
You take the initial URL of the script
http://www.yoursite.com/cgi-bin/amazon_products_feed.cgi
and add the variables after it with the first variable preceded by a ? -
http://www.yoursite.com/cgi-bin/amazon_products_feed.cgi?input_mode=books
More variables can be added with all of them preceded by a & -
http://www.yoursite.com/cgi-bin/amazon_products_feed.cgi?input_mode=books&input_templates=3
The most commonly used URL options are
Amazon Products feed uses categories to browse through Amazon.com's product database. You can only browse/search inside of a specified category. With Amazon Web Services, it's not
currently possible to search all of Amazon's products.
To display a specific category of bestsellers:
input_id - this is the category number that you wish to display the bestsellers of.
For information on how to find category numbers that work with Web Services click here.
The input_id numbers that the script already knows and uses for browsing are listed here
To add a search box to other pages of your site, simply cut-n-paste the code below:
<FORM Method="get" Action="/cgi-bin/amazon_products_feed.cgi">
<SELECT Name="input_mode"><OPTION Value="baby">Baby <OPTION Value="books" Selected>Books <OPTION Value="photo">Camera & Photo <OPTION Value="classical">Classical Music <OPTION Value="videogames">Computer & Video Games <OPTION Value="pc_hardware">Computers <OPTION Value="dvd">DVD <OPTION Value="electronics">Electronics <OPTION Value="kitchen">Kitchen & Housewares <OPTION Value="magazines">Magazines <OPTION Value="garden">Outdoor Living <OPTION Value="music">Popular Music <OPTION Value="software">Software <OPTION Value="universal">Tools & Hardware <OPTION Value="toys">Toys & Games <OPTION Value="vhs">Video</SELECT> </FORM> |
You can insert search results into any of your web pages using a couple of ways. Search engines will even index these as part of your web page.
This stands for server-side includes, which means that when the page is requested by the users browser, your server combines this with the rest of the HTML. To do this, most hosting
companies require that your pages have .shtml extensions. You can try to use these with .htm extensions to see if it will work, and some hosting companies let you specify .htm pages
to utilize SSI Includes. But you need to contact your hosting for details on that.
To use an SSI Include, it's very simple, let's say you want to display the top selling video games, like here:
here's your URL:
http://www.yoursite.com/cgi-bin/amazon_products_feed.cgi?input_mode=videogames&input_id=471280
To include these results, remove the domain name from the URL and use this
<!--#include virtual="/cgi-bin/amazon_products_feed.cgi?input_mode=videogames&input_id=471280" -->
Now one roadblock to this, is it will display all of the content from your page template as well. So you should modify your page and
products template to get the results you want. Basically a page template with just %%products_html%% will work,
since you don't need the <HEAD><TITLE> elements. And maybe a simpler products template so it won't take up as much room.
You should only use a php inlcude if your pages are coded in php because they require the .php extension to run properly. If your pages are not php, use the SSI include above.
To do the same example as above with php use:
<?php
include_once("http://www.absolutefreebies.com/cgi-bin/amazon_products_feed.cgi?
input_mode=videogames&input_id=471280");
?>
APF options were designed so you can customize your templates even further than standard HTML.
The options and the HTML they effect are enclosed in a special comment tag.
<!--apf &option1=value&option2=value! HTML here !-->
Notice the exclamation points, they separate the different parts of the command. <!--apf tells the script that options
will follow. All options must be proceeded by an & to separate them and the last option is indicated by following it with an !.
Anything following that ! through !--> is considered the HTML you want to control. If the option doesn't contain HTML, like for
including a text file, the exclamation points still need to be there. The examples below will show how these options can be used.
Product #1 |
Product#2 |
Product#3 |
Product#4 |
Product #1 | Product #2 |
Product #3 | Product #4 |
If you look at this page, you may notice a navigation menu on the left of the products, this menu changes as you
choose different categories. It will display the different sub-categories for whatever category you are in. You
can change how this looks by modifying the nav_menu template. To use this in your page use the following tag in your
page template above your %%products_html%% as in this sample page template. This utilizes the APF Options described above.
<!--apf &apf_include=nav_menu!
<TD Align="left" Valign="top" Width="160"><TABLE Bgcolor="#FFDC91" Width="100%"> %%nav_menu_html%%</TABLE></TD>
!-->
the Navigation menu uses the nav_menu template. To use one other than the default, upload it to your server and specify it in the script:
@nav_menu_templates = ("nav_menu_1.template", "nav_menu_2.template");
If you look at this page you will see a box with a featured product.
To change how this looks you can modify the featured_product templates. To add the featured product to your pages, use the apf_include described above.
Setting this equal to random will cause it to pick an item at random from @featured_products.
<!--apf &apf_featured_product=random!!-->
You can specify a single ASIN to display that individual product.
<!--apf &apf_featured_product=B00007EFIY!!-->
Or several ASINs to display one from that list at random.
<!--apf &apf_featured_product=0071410090,1878346334,1893128121,189166123X,1878346490!!-->
The Featured Product uses a the featured_product template. To use one other than the default, upload it to your server and specify it in the script:
@featured_product_templates = ("featured_product_1.template", "featured_product_2.template");
Languages work like the templates. Simple text files of all the variables that contain the text the script displays that does not come from Amazon. If you
wish to create your own language file please use the sample English file as a starting point and be sure and send me a copy so we can share it with others.
I would like to provide as many different languages as possible.
@language_templates should point to a file (or files) that contains the language you wish to display. If blank or non-existent will use embedded English.
Language files:
@language_templates = ("apf_english.language", "apf_dutch.language");
English - example file
You specify which language to use in the URL with input_language.
http://www.absolutefreebies.com/cgi-bin/amazon_products_feed.cgi?input_mode=books&input_language=1
To display multiple languages in HTML there is a special charset (character set) called Unicode. This is the format that Amazon sends their results in and so it is
what my script uses. To use accented characters in the language files you must use Unicode entities. Entities are just (a number);. I wrote a script to display
the characters and show the entity for each so you can use them in your language file - Unicode Generator.