Hi David,
I really should know this one, but I'm having a brain freeze over it, I need to parse this code out with a re-write condition if possible, I am calling it from the html folder into my index file, but I want the SEO instead of showing the search.php query string. Code is below:
<?php
$sql = "SELECT DISTINCT(category) as category FROM `".$config_databaseTablePrefix."products` ORDER BY category";
if (database_querySelect($sql,$rows))
{
print "<ul class='blue'>";
foreach($rows as $row)
{
print "<li><a href='".$config_baseHREF."search.php?q=category:".$row["category"]."'>".$row["category"]."</a></li>";
}
print "</ul>";
}
?>
Thanks in advance,
Ray
Hello Ray,
The rewrite version of the category search results is /category/Category-Name/ so in place of:
print "<li><a href='".$config_baseHREF."search.php?q=category:".$row["category"]."'>".$row["category"]."</a></li>";
...have a go with:
print "<li><a href='".$config_baseHREF."category/".tapestry_hyphenate($row["category"])."/'>".$row["category"]."</a></li>";
Cheers,
David.