Basically what I’m after is a dynamic breadcrumb system, as follows:
1) Directory Page
url: /mysite/directory
breadcrumb: Home > Directory
2) Cars Section
url: /mysite/directory/cars
breadcrumb: Home > Directory > Cars
3) Cars Search Results
url: /mysite/directory/cars?query-string
breadcrumb: Home > Directory > Cars > Search Results
4) Product Details Page
url: /mysite/mercedes-benz
referrer: none
breadcrumb: Home > Mercedes Benz
5) Product Details Page derived from Cars Section
url: /mysite/mercedes-benz
referrer: /mysite/directory/cars
breadcrumb: Home > Directory > Cars > Mercedes Benz
6) Product Details Page derived from Cars Search Results
url: /mysite/mercedes-benz
referrer: /mysite/directory/cars?name=mercedes-benz
breadcrumb: Home > Directory > Cars > Search Results > Mercedes Benz
4 is easy to do, 5 & 6 are difficult. How can I do this? I think an obvious solution would be to use sessions, but I’d only use sessions if they will work properly with multiple windows/tabs.
Please also note in the above example ‘Cars’ is just a category - products can belong to multiple categories. So for example Mercedes Benz may also belong to category “Transport”.