I installed the latest dev version in the hopes of overriding my FAQ breadcrumbs. I put the "hook_custom_breadcrumbsapi" into my FAQ module. And, I get the custom crumbs to work just fine on the upper level pages (the lists of FAQs) by making module page breadcrumbs for each one of the faq module pages.

But I can't get it to work on the pages that actually have the Q/A pair (which is the only part I am using!)

All of my faq pages have the path "/faq" and I am using a page-faq.tpl.php page to style the page for the Q/A pair. This page doesn't seem to show up as a module page option in custom breadcrumbs, which may be part of the problem?

Any ideas on where I am going wrong are greatly appreciated.

CommentFileSizeAuthor
#5 723704_assign_template_breadcrumb.diff830 bytesMGN
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MGN’s picture

If you are referring to the faq nodes, then you can create a node-type custom breadcrumb for this node type. Any templates in the theme registry should appear in the list.

buttonwillowsix’s picture

I did create a node-type custom breadcrumb for the FAQ nodes (this was the first thing I tried.) However, those are overwritten by the FAQ module.

MGN’s picture

Ah yes, you did say that. I think page-faq isn't showing up because its an alternative template for the default page template. So the hook is page, not page-faq. Alternative templates are discovered dynamically and do not exist in the theme registry, so you can't supply a custom breadcrumb for the page-faq template. But I think there is a way to get what you are looking for.

Select the 'page' template from the list, and then for the breadcrumb visibility field try something like
return ($node->type == 'faq');
to only provide the custom breadcrumb for faq nodes.

EDIT:
Scratch that...the $node object isn't available, but perhaps you can use the path to decide?
return (arg(0) == 'faq');

buttonwillowsix’s picture

Sadly that didn't work either.
Anyhow, thanks for the idea! It makes sense that the hook would be "page", which I hadn't been thinking about. Too bad that doesn't make the FAQ module ignore it. :)

MGN’s picture

Version: 6.x-2.0-beta2 » 6.x-2.x-dev
Component: custom_breadcrumbs » Code
Assigned: Unassigned » MGN
Category: support » bug
Status: Active » Needs review
FileSize
830 bytes

Ok. I think I found the problem. The attached patch adds a single line to the custom_breadcrumbsapi.module.

Once you've patched the file, set up a module page custom breadcrumb using the 'page' template.

For breadcrumb visibility, try

return (arg(0,$_REQUEST['q']) == 'faq');

so the custom breadcrumb is only applied to pages with a path alias starting with 'faq'.

MGN’s picture

Status: Needs review » Fixed

Committed the patch in #5 to 6.x-2.x-dev for further testing. http://drupal.org/cvs?commit=339838

Status: Fixed » Closed (fixed)

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