Tag: astore

Construct navigation for your Amazon aStore using php and YUI

Amazon “aStores” are very easy to set up, but you will probably find you want to customize the navigation, particularly if you want to integrate the store into your own site. I’m in the process of doing just that, and decided to construct my own navigation system for the DesignSpace book shop.. The php script that creates the tabs for the store is based on the YUI (Yahoo UI) “Tab View Control” and can be easily adapted to your own site.

This is just a down and dirty approach but it is a good start for you to build from.

Continue reading

Construct a variable name in PHP from a string and another variable

The “Shop” page of this site is a php page which displays an amazon a-store category and the second level tabs appropriate to that category, using a “node id”.

The html for the tabs is defined in an included page like this:

<?php
//-------------//
$tabs6= '<ul class="yui-navset bd">';
$tabs6.='<li class="first selected" id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs6.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs6.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs6.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs6.='</ul>';

$tabs180= '<ul class="yui-navset bd">';
$tabs180.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs180.='<li class="selected" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs180.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs180.='</ul>';

$tabs183= '<ul class="yui-navset bd">';
$tabs183.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs183.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs183.='<li class=" selected" id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs183.='</ul>';

?>
Continue reading