Jump to content

Breadcrumb for PHP files only


kurt.santo

Recommended Posts

Working on my mate's website and would like to include breadcrumb for section with his products (mainly is the product template and some entry pages). Only those files are PHP. The rest of the site is simple HTML and as it does not change often I will just hard-code the breadcrumb for those pages.Having major problems with some JavaScript breadcrumb scripts (due to not knowing too much about it) I wondered if I am going wrong anyway and should use PHP instead. I heard before that I should use JavaScript, but searching on the web for JavaScript breadcrumb scripts I always come across some PHP scripts, which does not help my caos... What would you guys recommend?Kurt

Link to comment
Share on other sites

If the products are all in categories and you want to show a path to the current product through the categories, I would just figure out which category the current product is in from the database, and keep working backward through the categories until you get to the products page or home page or wherever you want to start from.

Link to comment
Share on other sites

If the products are all in categories and you want to show a path to the current product through the categories, I would just figure out which category the current product is in from the database, and keep working backward through the categories until you get to the products page or home page or wherever you want to start from.
Would it be possible with that approach to also show one level only if the user came that path? There is one level with "view by room" or "view by range", which is optional as the user has the option to click immediately on a range or room (but he has to click a range or room first to open the options in there)...Kurt
Link to comment
Share on other sites

You can use the session to keep track of which pages they have viewed so far if you want, and then display those.
Oh, my lord what did I get myself into;-) Guess it will take me ten years to make that website work... Can you recommend a site where they would have script samples?Kurt
Link to comment
Share on other sites

I'm not sure, I just typically use the PHP manual at php.net. It's a little technical and some people find it hard to read, but it gives you all the information you need and nothing you don't.http://www.php.net/manual/en/ref.session.phpScroll down the page and check the examples, all you need to do to use the session is use the session_start function on each page and then you can use the $_SESSION array to access all the session variables.

Link to comment
Share on other sites

I'm not sure, I just typically use the PHP manual at php.net. It's a little technical and some people find it hard to read, but it gives you all the information you need and nothing you don't.http://www.php.net/manual/en/ref.session.phpScroll down the page and check the examples, all you need to do to use the session is use the session_start function on each page and then you can use the $_SESSION array to access all the session variables.
Will certainly try to have a good read... Cheers...Kurt
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...