it just feels incomplete if when viewing a node page, the node title isn't included but when viewing a term, everything is there.

so when viewing a node, it will be like this:
home >> [vocab] >> [term] >> ... >> [term] >> node title

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MGN’s picture

Component: User interface » Code
Status: Active » Postponed

Thanks for the suggestion. I agree and that's what the custom breadcrumb module is designed to handle. I actually use both modules, and am considering a merge with that module so we can combine features in one module. See the custom_breadcrumb issue queue for more details. I am marking this as postponed until we see what happens with the maintainership of the custom breadcrumb module.

radj’s picture

I did try custom breadcrumb and it did place the node title on the breadcrumb. However, the breadcrumb between Home and Node title is inflexible and depends on your inputs in the admin page. The termpath in the breadcrumb also appears as one link unlike this module which displays each term in the termpath as a separate link in the crumb.

stevenghines’s picture

Hi radj,

I am in the same situation so I have patched my copy of 5.x-1.4 with the attached. It's probably a bit of a hack, but might see you through until Custom Breadcrumb and Taxonomy Breadcrumb merge.

The code basically adds on the title of the current node to the end of the $breadcrumb array before it gets sent off to the drupal_set_breadcrumb function. Note that it is assumed that node titles are never empty; if this is an incorrect assumption then let me know and I'll modify accordingly.

radj’s picture

Status: Postponed » Reviewed & tested by the community

Thanks, stevenghines! It works. Didn't know it was that simple. I should start learning Drupal dev. ^_^

MGN’s picture

Status: Reviewed & tested by the community » Needs work

Rather than making this the default for everyone, there should be an option set at admin/settings/taxonomy-breadcrumb (in the basic settings fieldset).

I cannot commit the patch as it is currently written because it fundamentally changes the (now expected) taxonomy_breadcrumb behavior.

@radj, speaking of development, would you like to extend your patch to give admin control over this new feature? It needs a single checkbox with a brief explanation of the behavior, and then read the checkbox value using variable_get() before adding the node title.

@stevenghines I'll give you first crack at it since you posted the patch. Requires a little knowledge of forms, but its a straightforward task.

radj’s picture

I'd love to try that. I'll find time. Do you know any sample that I can start off from so I can be guided? What function to look in?

stevenghines’s picture

I'll have a go at that - thanks for the tips.

Can't promise anything very quickly I'm afraid as I've got a fair bit on at the moment, but I'll try to get something done.

@radj if you believe you can get something done quickly then please feel free, otherwise I'll post an updated patch when I can.

MGN’s picture

I think one of the best places to learn is by investigating similar code in the same (or other) modules. In this case, begin with the code in taxonomy_breadcrumb.admin.inc. The code to emulate involves 'taxonomy_breadcrumb_show_current_term' . See how the state of this variable is used to modify the breadcrumb in taxonomy_breadcrumb.inc ? I expect something similar using stevenghines code would work very well.

I Hope this helps. I'll be happy to review the patch when its ready. Thanks for your help!

radj’s picture

Wheee! this is fun! and quick!

I made it work but I'm not sure how to make the .patch file. What's the best way to go for creating .patch files in Windows without having to install CVS?

radj’s picture

Attached patches! Created them using Beyond Compare. I hope it's OK. ^_^

MGN’s picture

Status: Needs work » Patch (to be ported)

Not bad. A couple of items to note. When submitting a patch, the code needs to adhere to the drupal coding standards. I see a couple of mistakes (indents should be 2 spaces, not three, and , but I can clean those up this time. Also remember to change the status to 'patch: code needs review' so people are aware of the new patch.

Also, I think the default (recommended setting) should have the new feature disabled (check-box unchecked) to preserve what is now the normal, expected, behavior. Its easy enough to enable if needed. So I am going to replace the 'TAXONOMY_BREADCRUMB_INCLUDE_NODE_TITLE' with FALSE, remove the define, and the edit the description a little before committing.

Thanks again for contributing!

radj’s picture

I see! Thanks for the valuable feedback, MGN.

Feels good to contribute, even a little. Lol.

916Designs’s picture

Drupal 6 version:

1. Apply taxonomy_breadcrumb.admin_.inc_.patch from comment #10
2. Patch for taxonomy_breadcrumb.module is very similar, just add these two lines and an empty line before drupal_set_breadcrumb in function taxonomy_breadcrumb_nodeapi

So this
drupal_set_breadcrumb($breadcrumb);

Becomes

      if(variable_get('taxonomy_breadcrumb_include_node_title', TAXONOMY_BREADCRUMB_INCLUDE_NODE_TITLE))
        $breadcrumb[] = $node->title;
        
        drupal_set_breadcrumb($breadcrumb);     

Sorry I don't have time for a proper patch.

MGN’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Patch (to be ported) » Fixed

With Drupal 7 on the horizon, I am less inclined to add feature requests to the 5.x version. This feature is currently implemented in the 6.x-1.x version.

Status: Fixed » Closed (fixed)

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