Jump to content

Breadcrumb for PHP files only


kurt.santo
 Share

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...