Hi David,
I have created subcategories in sub folder in the index.php and I have p use this code http://www.pricetapestry.com/node/2161 for the index.php. I wish to have just only the subcategories in only 4 column without A-Z and all the categories combine into 4 column like show below.
Current Code:
{code saved}
Hi,
If you don't require the A to Z layout, have a go with the following code
<?php
$columns = 4;
$currentColumn = 0;
$sql = "SELECT DISTINCT(category) as category FROM `".$config_databaseTablePrefix."products` WHERE category <> '' ORDER BY category";
if (database_querySelect($sql,$rows))
{
print "<table>";
print "<tr>";
foreach($rows as $product)
{
if ($config_useRewrite)
{
$href = tapestry_hyphenate($product["category"])."/";
}
else
{
$href = "search.php?q=category:".urlencode($product["category"]).":";
}
print "<td><a href='".$href."'>".$product["category"]."</a></td>";
$currentColumn++;
if ($currentColumn == $columns)
{
print "</tr><tr>";
}
}
print "</tr>";
print "</table>";
}
?>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com