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.
Comment | File | Size | Author |
---|---|---|---|
#5 | 723704_assign_template_breadcrumb.diff | 830 bytes | MGN |
Comments
Comment #1
MGN CreditAttribution: MGN commentedIf 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.
Comment #2
buttonwillowsix CreditAttribution: buttonwillowsix commentedI 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.
Comment #3
MGN CreditAttribution: MGN commentedAh 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');
Comment #4
buttonwillowsix CreditAttribution: buttonwillowsix commentedSadly 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. :)
Comment #5
MGN CreditAttribution: MGN commentedOk. 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
so the custom breadcrumb is only applied to pages with a path alias starting with 'faq'.
Comment #6
MGN CreditAttribution: MGN commentedCommitted the patch in #5 to 6.x-2.x-dev for further testing. http://drupal.org/cvs?commit=339838