Integrate with custom breadcrumbs
Michelle - September 8, 2009 - 02:04
| Project: | Advanced Forum |
| Version: | 6.x-2.x-dev |
| Component: | Other module integration |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
| Project: | Advanced Forum |
| Version: | 6.x-2.x-dev |
| Component: | Other module integration |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
#1
Continuing the conversation from #540766: Breadcrumbs specific to forum wrapper pages (by template?)...
This patch would allow custom breadcrumbs to set the breadcrumb on the advanced forum listing page. Sorry its against AF 6.x-1.1, I checked out the wrong version. Still, I think its easily transported.
I just dropped the hook that allows access to set the breadcrumb (via drupal_alter) into advanced_forum_preprocess_forums() because the core forum module sets the breadcrumb in template_preprocess_forums().
Hope this makes sense! Thanks for considering it.
#2
Thanks and sorry for not responding. I'm going to have my head in APK a while longer then will get back to AF.
Michelle
#3
I'm afraid this is not working for me.
I added the patch to my af module and it worked fine for the landing page of the forums but, so far I can't get cb to touch the wrapper pages. I've tried using paths but that does not work. This is issue one.
The second issue is that this mod overrides the some of the views custom breadcrumbs I've made! I've used the admin interface to adjust the weight of the modules, but the API in AF still overrides two of the three views custom breadcrumbs I've made.
I've even played with the weight column in the system table of the db. No change, the custom api still overrides the views!
#4
It's not a bug just because a proposed, uncommitted integration isn't working...
I haven't had a chance to look at integrating these two modules, yet. It's not a real high priority for me. If someone comes up with a working patch in the mean time, that would be great.
Michelle
#5
I ended up putting the following in place while better folks than I work through the patch:
I enabled the following settings in Custom Breadcrumb:
- Use the taxonomy hierarchy to set the breadcrumb trail for nodes and taxonomy pages
- Show vocabulary in breadcrumb trail
- Show current taxonomy term in breadcrumb trail
- Show current node title in taxonomy breadcrumb trail
- Include or exclude taxonomy-based breadcrumbs for the following node types:
- Include Forum Post.
I made a Custom Breadcrumb for the Forums vocabulary so that it would link properly.
Then, I pretty much let Forums and Custom Breadcrumb construct the breadcrumbs, with the following modification to template.tpl.php:
function phptemplate_breadcrumb($breadcrumb) {if (!empty($breadcrumb)) {
/* Make sure that the forum listing forum is on the breadcrumb*/
if(arg(0) == 'forum'){
if (!arg(1)){
$breadcrumb[0] = l('Forums', 'forum');
}
else {
/* Remove Home */
unset($breadcrumb[0]);
if (is_numeric(arg(1))){
$term_obj = taxonomy_get_term(arg(1));
array_push($breadcrumb, l($term_obj->name, 'forum/' . arg(1)));
}
}
}
return '<div class="breadcrumb">'. implode(' » ', $breadcrumb) .'</div>';
}
}
It isn't the most flexible code/solution - and maybe not the best way to do it, but it did seem to work reliably as a stop-gap.
#6
@abowers: Thanks for sharing. Not sure when I'll get to this. I don't use custom breadcrumbs, though I might in the future.
Michelle