Hi MGN;

I'm using Custom Breadcrumbs 6.x-2.x-dev, updated today (7/10).

I have a hierarchy/taxonomy as follows:
Support
  [Vocabulary]
    [Term]
      Article page
  
Breadcrumbs should be (for example):
Support: Home
  Knowledge Base: Home > Support
    Setup: Home > Support > Knowledge Base
      How to Install: Home > Support > Knowledge Base > Setup

For the vocabulary page I'm using a path custom breadcrumb - works fine.

For the term and article pages I'm using a taxonomy_vocabulary custom breadcrumb as follows:
Titles:
  Support
  Knowledge Base
  [term]

Paths:
  support
  support/knowledge-base
  [termalias]

Article page, custom breadcrumb works fine.
Problem is that for the term page (Setup), I get:
Home > Knowledge Base
and the path for Knowledge Base is malformed. It looks like:

support%0D%0Asupport/knowledge-base%0D%0A%5Btermalias%5D

Which appears to be the path specification with CRLFs and the brackets represented as character values. Thus is it appears that a single title is coming through and the entire path designation is being applied to that one title. i.e:

<a href="/support%0D%0Asupport/knowledge-base%0D%0A%5Btermalias%5D">Knowledge Base</a>

Using Drupal for Firebug, here are the queries I see for custom_breadcrumbs_load_breadcrumbs:

term page:
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_paths WHERE language IN ('en','') ORDER BY language ASC
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_taxonomy_vocabulary WHERE vid = '7'
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_taxonomy_term WHERE tid = '14' [not found]

detail page:
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_paths WHERE language IN ('en','') ORDER BY language ASC
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumb WHERE node_type = 'kbitem' AND language IN ('en','') ORDER BY language ASC
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_paths WHERE language IN ('en','') ORDER BY language ASC
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_taxonomy_term WHERE tid = '14' AND language IN ('en','') ORDER BY language ASC
  custom_breadcrumbs_load_breadcrumbs SELECT * FROM custom_breadcrumbs_taxonomy_vocabulary WHERE vid = '7' AND language IN ('en','') ORDER BY language ASC

Is this is a bug or am I misunderstanding the proper way to set this up?

Thanks much.

Comments

MGN’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for testing. I'll look into this. Can you tell me what settings you have enabled at admin/settings/custom-breadcrumbs?

Thanks

madnomad’s picture

The only items enabled are:
- Use wildcard pattern matching in paths
- Force the active trail

thanks.

MGN’s picture

Ok. And are your [term] pages taxonomy term pages (i.e. located at taxonomy/term/%) supplied by the taxonomy module or by views?, or are they nodes or some other content type?

Thanks.

MGN’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Fixed

I was able to verify the problem and have just committed the fix to CVS. It should be available in the next nightly snapshot of 6.x-2.x-dev.

Please try the latest version and report back here if the problem persists.

Thanks.

madnomad’s picture

Thanks, MGN. It's almost fixed...

I'm using taxonomy term pages here, not views.

Using the Custom Breadcrumb taxonomy_vocabulary rule described above, I now get:

index page: Home > Support > Knowledge Base > [term]
item page: Home > Support > Knowledge Base > Setup

what I want is:
index page: Home > Support > Knowledge Base
item page: Home > Support > Knowledge Base > Setup

I tried creating two taxonomy_vocabulary rules - one for index, one for item - where the rule for index omits [term]. I'm then using a php snippet to make the display conditional on $node values. I get the same result.

It seems to work if I force it with 'return true;' and 'return false;' so I'm not sure I'm testing correctly on $node. Is there a primer available somewhere that outlines the options for conditionals in the Breadcrumb Visibility field?

tnx.

MGN’s picture

The breadcrumb visibility field can accept any php snippet that returns boolean TRUE or FALSE.

Since the [term] and [termalias] tokens only work for node objects, you wouldn't want to use those for the taxonomy term page (i.e. your index page, if I understand correctly).

So you could set two custom_breadcrumb_vocabulary breadcrumbs, one for the node pages and one for the taxonomy term pages and use the breadcrumb visibility to determine which one is displayed. There are many php snippets that could do this. One way would be to use the arg function to get the first part of the drupal path: If viewing a node page it will be 'node', but if its a taxonomy term page it will be 'taxonomy'.

Your item page is a node, so you could use:

Breadcrumb visibility:
return (arg(0) == 'node');
Titles:
Support
Knowledge Base
[term]
Paths:
support
support/knowledge-base
[termalias]

For your index page you could use:

Breadcrumb visibility:
return (arg(0) == 'taxonomy');
Titles:
Support
Knowledge Base
Paths:
support
support/knowledge-base

madnomad’s picture

Perfect! Thanks a ton.

Status: Fixed » Closed (fixed)

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