![]() |
Breadcrumb Navigation?
Yeah... It just doesn't feel like this is the right way.
I serialize an array of the home/category/.../page breadcrumbness, and then I do this... It just doesn't seem like the right method. Any help? PHP Code:
|
Quote:
Now, breadcrumbs are just links on a navbar correct? |
I was actually hoping for some totally different method >.< breadcrumb navigation is at the top of this page.
" TalkPHP > Developer Forums > General » Breadcrumb Navigation?" |
I forgot what a breadcrumb was, thanks.
But your breadcrumb isn't in the sql, so what are you doing? |
There's a lot of different ways you could go about it. I think he's referring to a method of using the URI to build a breadcrumb, not one based on any database. Off the top of my head,
PHP Code:
-m |
Actually, it is from a database that I need to pull the information.
The name of the crumb will be the title column of the page, the problem is dynamic URLs and actually figuring out what pages are above the current one. Also, delayed, why do you say URI? I wouldn't use a URN, and I doubt 99% of the web development community would use one, so why confuse non-web-savvy people like me by saying URI? :( |
I use them pretty interchangeably, considering a URL is a URI. Just one of those pesky habits.
-m |
Please see the following article:
Storing Hierarchical Data in a Database [PHP & MySQL Tutorials] I am not sure how you have your database setup, but my guess is you allow subcategories upon subcategories correct? And you link them by 'parent_id', which can cause a huge amount of queries. The tutorial above can show you how to setup categories properly, above all, get all children of x category and its breadcrumbs with a grand total of 3 queries. This method you dont have to have the sql 'follow' the tree and have to re-query each time it gets a child deeper. They even have a function on the tutorial somewhere that will convert your parent_id linkage to the correct method. Good luck!! |
| All times are GMT. The time now is 12:29 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0