x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

Breadcrumb Navigation

Concept

By using the categories code and properly structuring your categories, you can create something that looks an awful lot like a hierarchical site structure - and add breadcrumb navigation to your entries.

Requirements

Note: If you want to continue having lists of related entries, you may want to think about installing the Tag Module or using some other folksonomy method.

Structuring Your Site

Your first step will be to figure out how you want to organize your site. Then, create the categories and structure to match this organization. For example, if you want to talk about games, display your book and movie reviews, and post photos online, your category structure might look like this:
Games
* single-person shooter
* multiplayer
** online
** real world
Reviews
* books
* movies
Photos
* indoor
** landscapes
** family
* outdoor

When assigning a category to a particular entry, assign it to the deepest child, and to all that child’s parents. For example, a photo of your kids’ birthday party would go into Photos | indoor | family.

Adding the Code

Add the following code in your entry templates, inside your weblogs tag:

You are here: {categories}<a href="{path=weblog/category}">{category_name}</a> > {/categories}{title}

Using the example above, this prints out this information:

You are here: Photos > Indoor > Family > The kids’ birthday party!!!

EE Setting Notes

* Don’t forget to change the path information to your correct template group and template name.
* Make sure that when you assign an entry to a category, the entry is automatically added to the parent categories as well. To check this, log in to your control panel, select “Global Weblog Preferences”, and set “Auto-Assign Category Parents” to “Yes”.

Category:Categories Category:EE Coding Category:Tricks