Hi:
right now when I do a search for either a keyword or click on a category, the query only shows inside the search bar. Is there a way where it can show the search path next to the "home" button which is on top of the search bar in search.php and also categories, merchants page, etc?
thanks
Thank you so much for the above but I have 1 more request:
Can it be home > category > product
instead of home > search query ?
Hiya,
That can be done something like this:
html/menu.php:
<div class='menu'>
<p>
<small>
<a href='<?php print $config_baseHREF; ?>'><?php print translate("Home"); ?></a>
<?php if (isset($product["products"][0]["category"])): ?>
> <a href='<?php print $config_baseHREF; ?>search.php?q=category:<?php print urlencode($product["products"][0]["category"]); ?>:'><?php print $product["products"][0]["category"]; ?></a>
> <?php print $product["products"][0]["name"]; ?>
<?php elseif(isset($parts[1])): ?>
> <a href='<?php print $config_baseHREF; ?>search.php?q=<?php print urlencode($q); ?>'><?php print htmlentities($parts[1],ENT_QUOTES,$config_charset); ?></a>
<?php endif; ?>
</small>
</p>
</div>
Nice mod actually :)
Cheers,
David.
good mod.. can we have the mod_rewrite version of this?
Hi atman,
Here's a mod_rewrite version:
<div class='menu'>
<p>
<small>
<a href='<?php print $config_baseHREF; ?>'><?php print translate("Home"); ?></a>
<?php if (isset($product["products"][0]["category"])): ?>
> <a href='<?php print $config_baseHREF."category/".tapestry_hyphenate($product["products"][0]["category"])."/"; ?>'><?php print $product["products"][0]["category"]; ?></a>
> <?php print $product["products"][0]["name"]; ?>
<?php elseif(isset($parts[1]) && ($parts[0]=="category")): ?>
> <a href='<?php print $config_baseHREF."category/".tapestry_hyphenate($parts[1])."/"; ?>'><?php print htmlentities($parts[1],ENT_QUOTES,$config_charset); ?></a>
<?php endif; ?>
</small>
</p>
</div>
Cheers,
David.
Hi,
This should be reasonably straight forward. The search query is always in the $q variable through all the scripts, so you could add it to the menu something like this:
html/menu.php
<div class='menu'>
<p>
<small>
<a href='<?php print $config_baseHREF; ?>'><?php print translate("Home"); ?></a>
<a href='<?php print $config_baseHREF; ?>search.php?q=<?php print urlencode($q); ?>'><?php print htmlentities($q,ENT_QUOTES,$config_charset); ?></a>
</small>
</p>
</div>
Hope this helps!
Cheers,
David.