Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Full breadcrumb trail?


Vger

Recommended Posts

At present the standard osCommerce breadcrumb trail works like this - when you go from the homepage to page 1 it shows Home --> Page1, but when you go from Page 1 to Page 2 it doesn't show Home --> Page 1 --> Page 2, it just shows Home --> Page 2. I would like to change this so that the breadcrumb trail can follow the hierarchy of pages, but don't know how to do this. Can anyone help?

 

Thanks in advance - Vger

Link to comment
Share on other sites

  • 6 months later...

It sounds like something was changed. I am getting a full path from the home page. Pages I have located for the breadcrumb trail are the breadcrumb.php and the application_top.php.

 

Have to start somewhere... application_top.php at the bottom of the page... and this is just a guess

 

// include the breadcrumb class and start the breadcrumb trail

require(DIR_WS_CLASSES . 'breadcrumb.php');

$breadcrumb = new breadcrumb;

 

$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

$breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

 

if its not this then my second guess would be the breadcrumb.php ....

 

just happened to have the pages open as I was thinking it would be nice to apply a different color to the last word in the trail via a span tag from the css...

Read, read, read, test, read, read, test, read, implement.

Always back up your site and database before changes.

Always back up on a regular basis.

Link to comment
Share on other sites

  • 3 months later...

You can hardcode it in your root level files (which is what I do), but only for static pages (not default osCommerce cPaths). Or you can use the navigation class - which clears extra links by default (see bold text).

 

Hardcoding example (to go on sub-category page)

----------------------------------------------------------

 

$breadcrumb->add('Main Category Name Here', tep_href_link(FILENAME_MAIN_CATEGORY));$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_MAIN_CATEGORY2));

 

navigation coding

-----------

CODE

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

$navigation->clear_snapshot();

tep_redirect($origin_href);

}

 

 

 

The class can be found in catalog/includes/classes/navigation_history.php

 

Vger

Link to comment
Share on other sites

navigation coding

-----------

CODE 

      if (sizeof($navigation->snapshot) > 0) {

        $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

        $navigation->clear_snapshot();

        tep_redirect($origin_href);

    }

The class can be found in catalog/includes/classes/navigation_history.php

 

Vger

 

No quite with you on this! (OK it flew straight over my head!!) Not very good at this php stuff yet! Do I need to add this code into navigation_history.php? It didn't seem to make a difference.

 

Sarah

Link to comment
Share on other sites

Agh sorry - this is something I did a long time ago and have now realised that I've forgotten what changes I did make to that file.

 

If I remember (will try to) I will post it here.

 

Vger

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...