Allow cb_taxonomy breadcrumb to be appended to existing breadcrumb and work with views

tmdrupal - June 24, 2009 - 20:38
Project:Custom Breadcrumbs
Version:6.x-2.x-dev
Component:custom_breadcrumbs_taxonomy
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,

I think I'm misunderstanding how custom_breadcrumbs_taxonomy and custom_breadcrumbs_views are supposed to work. The readme says custom_breadcrumbs_taxonomy "provides custom breadcrumbs on taxonomy term pages..." I have "Use the taxonomy hierarchy to set the breadcrumb trail for nodes and taxonomy pages" checked in the settings. However, when I browse to, say, taxonomy/term/77 (or its alias generated by pathauto), there's no breadcrumb.

However, if I go to admin/build/custom_breadcrumbs/views/add, and select "taxonomy/term/%" from the dropdown and create a path, then I get a breadcrumb on my taxonomy/term/77 page. It seems to me that a "taxonomy term page" (as it reads in the readme) is a view.

Ideally, I want to browse to taxonomy/term/77 and see a breadcrumb of Home > Resources > vocab > term 1 > term 2 > term 3 etc.

I have a hundreds of taxonomy terms, many of which are tags, so creating a custom trail for each isn't feasible.

What am I misunderstanding?

And help appreciated!

Thanks
Tom

#1

MGN - June 24, 2009 - 21:04

The views module overrides the core taxonomy term pages. So if you have that view enabled then cb_taxonomy will not provide custom breadcrumbs on pages like taxonomy/term/77, for example, you would have to use cb_views to do that (as you have discovered).

Try disabling the taxonomy_term view at admin/build/views so cb_taxonomy can set the breadcrumb trail for you. If you check the "Use the taxonomy hierarchy to set the breadcrumb trail for nodes and taxonomy pages" option on the cb settings page, you won't have to set the breadcrumbs individually.

The only piece that probably will not work is the "Resources" part of the trail. It sounds like you would like to be able to set the title and path for a crumb following "Home" but before the taxonomy trail?

#2

tmdrupal - June 25, 2009 - 14:30

MGN,

Thanks -- that makes sense. I disabled my taxonomy/term/% view and now the breadcrumb shows up on the taxonomy pages (albeit without the vocabulary name as the first item in the breadcrumb -- it only shows the hierarchy of terms -- is that right?). Of course, the downside to this is that the page is now the default "river of news" and I lose the formatting my view provides. Is this a trade-off or can I have the best of both worlds: custom view + taxonomy breadcrumb?

The only piece that probably will not work is the "Resources" part of the trail. It sounds like you would like to be able to set the title and path for a crumb following "Home" but before the taxonomy trail?

Yes. Almost all of my terms are only relevant to nodes which are "resource" on the site. I have a Resources section, and then you can browse by taxonomy. So, ideally, I'd have Home > Resources [which is the section I'd be under] > Vocab name > terms...

Thanks
Tom

#3

MGN - June 26, 2009 - 14:29

In core taxonomy, vocabulary pages don't have a defined callback like term pages do. So unless you specify a path there is not enough information to complete the breadcrumb trail. You can do this by creating a custom breadcrumb of type taxonomy_vocabulary and provide a path to a page that the vocabulary portion of the breadcrumb trail will link to. Once that path is provided, then the vocabulary will show.

Yes. Almost all of my terms are only relevant to nodes which are "resource" on the site. I have a Resources section, and then you can browse by taxonomy. So, ideally, I'd have Home > Resources [which is the section I'd be under] > Vocab name > terms...

The only way that I know how to do this with the existing module would be to restructure the taxonomy with Resources as a vocabulary with terms underneath it. Then you could link resources to an appropriate view of node.

I'll see if i can find a way of developing this into a feature to allow the taxonomy breadcrumb trail to be inserted into a custom breadcrumb.

#4

MGN - July 10, 2009 - 00:52
Title:Taxonomy term pages» Allow cb_taxonomy breadcrumb to be appended to existing breadcrumb and work with views
Category:support request» feature request
Status:active» fixed

Thanks for the feature request. I have implemented it in the latest 6.x-2.x-dev version, which will be available with the next nightly snapshot.

After upgrading to the latest dev, run update.php so custom_breadcrumbs_taxonomy can be given a module weight greater than custom_breadcrumbs_views.

Then visit custom breadcrumbs settings at admin/settings/custom-breadcrumbs. There you will see a few new options for taxonomy breadcrumbs. Enable the following (new) options

* Append taxonomy breadcrumb trail to current breadcrumb for selected node types
* Use taxonomy breadcrumbs for views
* Show vocabulary in breadcrumb trail

Now, you can use views to override taxonomy/term/% and set up a views type breadcrumb for those pages. Based on your examples, you will want something like

Titles
Resources

Paths
path/to/resources

You would also want to setup the same or similar node-type breadcrumb for the nodes returned by the view.

Now you'll have the breadcrumb trail you described above for (views) taxonomy term pages. The resources section is provided by either the views- or node-type breadcrumb, and the taxonomy structure (with text-only vocab name) is appended.

#5

tmdrupal - July 10, 2009 - 13:39

SWEET!

#6

System Message - July 24, 2009 - 13:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.