You are here:  » Breadcrumbs


Breadcrumbs

Submitted by stevewales20 on Fri, 2013-07-19 22:05 in

Hi David,

The code below is sort of working except for the url. How can i include the full href back to the last url?

/*search breadcrumbs */
      switch($parts[0])
      {
        case "merchant":
          $crumb1HREF = $config_baseHREF.($config_useRewrite ?$product["merchant"]:"merchants.php");
          $crumb1TEXT = $product["merchant"];
          $crumb2HREF = $config_baseHREF.($config_useRewrite?"merchant/"
                        .tapestry_hyphenate($parts[1])."/":"search.php?q=merchant:".urlencode($parts[1]).":");
          $crumb2TEXT = $merchantFilter;
          break;
        case "category":
          /* target categories */
$crumb1HREF = $config_baseHREF.($config_useRewrite?"category/"
                        .tapestry_hyphenate($parts[1])."/":"search.php?q=category:".urlencode($parts[1]).":");
          $crumb1TEXT = $categoryFilter;
if ($subCategoryFilter) {
$crumb2HREF = $config_baseHREF.($config_useRewrite?"category/"
                        .tapestry_hyphenate($parts[1])."/":"search.php?q=category:".urlencode($parts[1]).":");
$crumb2TEXT = $subCategoryFilter;
}
          break;
/*end of target categories */

Currently all search.php results go back to "search.php?q=category:".urlencode($parts[1]).". However i'd like to be able to go utilise the function you provided to me earlier. I've placed that in common.php so it's available globally.

{link saved}

As you can see i have it partially working. I can't figure out how to add the url that i've previously got from the searchfilters because they're included after the breadcrumbs. Also how i can use it to put it into the products page like "home > category > subcategory > product".

Any help is much appreciated, i understand this is a little outside of the scope of the software. I'm just trying to modify your breadcrumbs code to suit my purpose. Not getting very far heh.

Thank you very much.
Steve

Submitted by support on Sat, 2013-07-20 08:00

Hi Steve,

Where you have this section of code to generated $crumb2.... if $subCategoryFilter is set:

if ($subCategoryFilter) {
$crumb2HREF = $config_baseHREF.($config_useRewrite?"category/"
                        .tapestry_hyphenate($parts[1])."/":"search.php?q=category:".urlencode($parts[1]).":");
$crumb2TEXT = $subCategoryFilter;
}

...have a go with something like:

if ($subCategoryFilter) {
$crumb2HREF = $config_baseHREF."search.php?q=category:".urlencode($parts[1]).":&subCategoryFilter=".urlencode($subCategoryFilter);
$crumb2TEXT = $subCategoryFilter;
}

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by stevewales20 on Sat, 2013-07-20 16:52

Ah thanks david,

Inspired me to get there in the end. Still more modifications for different pages.

Who knew that a simple breadcrumbs trail could be so soul destroying lol

Thanks,
Steve