Hi,
I have noticed the one thing missing (for me anyway) is a basic category menu, just a list that shows all categories in a list, has anything been done like this? I realise the standard categories listing is way advanced of this request, but then I could style and integrate into my new design.
Thanks
Tony
Hi,
Thanks, the list appears but not as links, sorry if I did not make myself clear (a common failing, I expect everyone to be a mind reader!)
Thanks
Tony
Hi Tony,
I forgot to wrap the category name in the <a> tags;
print "<p>".$row["category"]."</p>";
...should be:
print "<p><a href='".$href."'>".$row["category"]."</a></p>";
corrected above...
Cheers,
David.
--
PriceTapestry.com
Got it, although it misses the 'category/' part out from the URL!!
Sorry Tony the above code comes from categories.php and so assumes category/ if using rewrite, have a go with:
<?php
$sql = "SELECT DISTINCT(category) as category FROM `".$config_databaseTablePrefix."products` WHERE category <> '' ORDER BY category";
if (database_querySelect($sql,$rows))
{
foreach($rows as $row)
{
if ($config_useRewrite)
{
$href = $config_baseHREF."category/".urlencode(tapestry_hyphenate($row["category"]))."/";
}
else
{
$href = $config_baseHREF."search.php?q=category:".urlencode($row["category"]).":";
}
print "<p><a href='".$href."'>".$row["category"]."</a></p>";
}
}
?>
(corrected above also)
Cheers,
David.
--
PriceTapestry.com
Hi Tony,
The code for just the category list without using the A-Z display for you to display how you want is as follows:
<?php
$sql = "SELECT DISTINCT(category) as category FROM `".$config_databaseTablePrefix."products` WHERE category <> '' ORDER BY category";
if (database_querySelect($sql,$rows))
{
foreach($rows as $row)
{
if ($config_useRewrite)
{
$href = $config_baseHREF."category/".urlencode(tapestry_hyphenate($row["category"]))."/";
}
else
{
$href = $config_baseHREF."search.php?q=category:".urlencode($row["category"]).":";
}
print "<p><a href='".$href."'>".$row["category"]."</a></p>";
}
}
?>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com