SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: PHP Breadcrumbs

  1. #1
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Breadcrumbs

    I have spent hours searching google, youtube and other resources to find a good, easy to follow tutorial on creating a breadcrumb trail navigation system in PHP but as yet haven't found it. Does anyone know of any such website, video cast that will be able to help me? If not then anyone want to help me into the right direction of where to start and what kind of techniques I should be looking at?

    Any help would be really appreciated as always.

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Is this an addition for an existing site, or is it for something you are planning?

  3. #3
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    building a new site from scratch and just need to know which direction to go and what to process to take

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Will all the content come from a db, or will it be using files in the directory structure of the OS?

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Further ...

    If the answer is database, maybe if you can explain how you see the "folder/folder/file" structure evolving in your database, then we can suggest ways of doing this.

    Is your data to be "polyhierarchical" ie. some content can appear in more than one path.

    /articles/people/Obama

    /articles/politics/Obama

    Might help if you explain what kind of site it is in general. A CMS? A blog? A gallery of products etc.

  6. #6
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Your system must know the hierarchy of any given page, so that it can present the appropriate breadcrumb, which is simply a list of links going up the chain.

    How this hierarchy is mapped is the key, usually mapped in the database.

  7. #7
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you may never get excat as you want but reading these i think you should be able to come up with something
    http://stackoverflow.com/questions/2...mic-breadcrumb
    http://www.phpriot.com/articles/breadcrumbs
    http://www.phpro.org/classes/Breadcrumbs.html

  8. #8
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    Sorry for the delay in replying but I have been away. Firstly, yes the content is coming from a database. The content will be products for sale that are placed in categories. The data will be 'polyhierarchical'. To be honest I never that that doing a breadcrumb could be potentially so complicated! The basic structure will be something like this: 'brand/brand-model/product'

  9. #9
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    It need not be complicated, but you are taking what is essentially a file system paradigm (folder/folder/file) and re-enacting it in a database.

    If you are serious about a polyhierchical structure so that you can essentially have:

    brand1/brand-model1/product1
    brand1/brand-model2/product1
    brand2/brand-model2/product1

    Where product1 is always the same page, but the breadcrumb permits the user to navigate "back up" to either :

    brand1/brand-model1 OR
    brand1/brand-model2 OR
    brand2/brand-model2

    .. depending on which way they got there, then the best option will be to maintain a referential table which stores all of those possible relationships.

    But are you sure that is what you want? Can product1 really belong to many brands?


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •