You are here:  » How do I change navigation menu?


How do I change navigation menu?

Submitted by chiquita on Mon, 2006-10-02 20:34 in

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

Submitted by support on Mon, 2006-10-02 20:43

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>
      &nbsp;
      <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.

Submitted by chiquita on Mon, 2006-10-02 21:09

Thank you so much for the above but I have 1 more request:
Can it be home > category > product
instead of home > search query ?

Submitted by support on Mon, 2006-10-02 21:53

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"])): ?>
      &nbsp;&gt;&nbsp;<a href='<?php print $config_baseHREF?>search.php?q=category:<?php print urlencode($product["products"][0]["category"]); ?>:'><?php print $product["products"][0]["category"]; ?></a>
      &nbsp;&gt;&nbsp;<?php print $product["products"][0]["name"]; ?>
      <?php elseif(isset($parts[1])): ?>
       &nbsp;&gt;&nbsp;<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.

Submitted by chiquita on Mon, 2006-10-02 22:27

Puuuurrrrrrrfeccct!

Thank you so much!

Submitted by atman on Tue, 2006-10-03 20:23

good mod.. can we have the mod_rewrite version of this?

Submitted by support on Wed, 2006-10-04 07:32

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"])): ?>
      &nbsp;&gt;&nbsp;<a href='<?php print $config_baseHREF."category/".tapestry_hyphenate($product["products"][0]["category"])."/"?>'><?php print $product["products"][0]["category"]; ?></a>
      &nbsp;&gt;&nbsp;<?php print $product["products"][0]["name"]; ?>
      <?php elseif(isset($parts[1]) && ($parts[0]=="category")): ?>
       &nbsp;&gt;&nbsp;<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.