We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New 'Breadcrumb' plugin available.

Development and Programming

MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

I’ve written an EE plugin that will let you show all ancestor categories of a given category. I call it the ‘Breadcrumb’ plugin. It’s attached to this post as ‘pi.breadcrumb.txt’. To use the attachment (save it into your plugin folder and) rename it to pi.breadcrumb.php.

Please try it out and give me your feedback about bugs etc. I plan to add the final version to the pMachines list of plugins for EE if you like. Thanks.

Note:

This plugin and the “Subcategories” Plugin are a pair.

The “breadcumb” Plugin will show the ancestor categories of a category and the “Subcategories” plugin will show the children categories of a category.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
19 years ago
Sue Crocker's avatar Sue Crocker

OK..

Now more importantly, how do you use the two together?

Do you have an example on your site using the plugin?

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

Well it’s rather easy. Both plugins use a current category, which can come from the url, or the “root_node” plugin parameter.

Assuming you have a category group with the following categories, and that your current category is 1.1.1:

1 –1.1 —-1.1.1 ——1.1.1.1 ——1.1.1.2 ——–1.1.1.2.1 ——–1.1.1.2.2 ——–1.1.1.2.3 ——1.1.1.3 —-1.1.2 —-1.1.3 etc.

a) The breadcrumb plugin will show you all ancestor categories of category 1.1.1. In this example:

1 1.1

b) The Subcategories plugin will show you all children categories of category 1.1.1. In this example:

1.1.1.1 1.1.1.2 1.1.1.3

See attached illustration:

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

Oh, and I would like to mention that, to show the current category (from the url) itself, I use the {exp:weblog:category_heading /} tag. 😊

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
19 years ago
Ingmar Greil's avatar Ingmar Greil

Can we see it in action somewhere? A site you built using these plugins?

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

The site I’m working on is not ready yet. But I will make an example template for the public soon.

Can I ask what exactly is not clear about how to use the plugins?

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

I have a new version with a fixed bug. It

       
xmaker's avatar
xmaker
6 posts
19 years ago
xmaker's avatar xmaker

Hello, please tell me how to install in EE latest version…

       
David Webb's avatar
David Webb
62 posts
19 years ago
David Webb's avatar David Webb

Download the plugin from the above post. copy it to your plugins folder in your ee system folder and then follow the instructions at the bottom of the plugin file for how to implement it.

       
xmaker's avatar
xmaker
6 posts
19 years ago
xmaker's avatar xmaker

I’m do it… I’m download, copy this plugin and paste code:

{exp:breadcrumb root_node="365" sort_direction="desc"} <li>{category_name}</li> {/exp:breadcrumb}

in index template, but don’t work.

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

Hi xmaker

Did you rename the file from: “pi.breadcrumb.txt” to “pi.breadcrumb.php”?

       
xmaker's avatar
xmaker
6 posts
19 years ago
xmaker's avatar xmaker

Yes, i’m rename this file, but don’t work.

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

And did you replace the root_node number (365) with the category ID from one of your category groups?

{exp:breadcrumb root_node="enter your category ID here" sort_direction="desc"}

       
xmaker's avatar
xmaker
6 posts
19 years ago
xmaker's avatar xmaker

Where i’m see my category ID?

       
MF's avatar
MF
15 posts
19 years ago
MF's avatar MF

You will find more info here in the user guide.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.