breadcrumb override problem
Hello, I'm upgrading and cleaning directory.module for Drupal 6. I am running on a breadcrumb problem. I think the Drupal core implementation of breadcrumbs is broken. First of all, there can only be one set of breadcrumbs. Imagine a blog post outlined in some book, with a few taxonomy terms. We potentially have three sets of breadcrumbs: the one set by each module involved (blog, book, taxononomy, though core taxonomy.module doesn't set the breadcrumbs on a node view.) To decide which breadcrumb will prevail, timing is everything: it will be the one set by the last call of drupal_set_breadcrumb() BEFORE the first call of drupal_get_breadcrumb(). I was trying to override the taxonomy.module's breadcrumbs on a taxonomy/term/nnn page, but: - if I call drupal_set_breadcrumb() from hook_help(), it's too late: the theming engine has already called drupal_get_breadcrumb() and my breadcrumbs are ignored. - if I call drupal_set_breadcrumb() from hook_init(), it's too early: taxonomy.module will override mine just before drupal_get_breadcrumb() gets called! So, now, I am a bit lost and don't know where I can best call drupal_set_breadcrumb() so that it comes after taxonomy's call, and before the first drupal_get_breadcrumb() call... Searching d.o, I've found many other issues in other crontrib modules which seem to deal with more or less the same problem, but I've not found a solution yet. So: 1) how should I solve my particular problem (the timing of drupal_set_breadcrumb() in my module to override/enhance taxonomy's breadcrumbs). 2) Do you agree that Drupal's core breadcrumbs handling could be improved, to make it possible to have several sets of breadcrumbs (why not? A good themer could accommodate them easily), or at least to make it easier to override / complement each other's breadcrumbs. If there's some kind of agreement on the second point, I'll open an issue for D7 with a summary of the discussion here. Blessings, Augustin. --
Augustin (Beginner) wrote:
1) how should I solve my particular problem (the timing of drupal_set_breadcrumb() in my module to override/enhance taxonomy's breadcrumbs).
Maybe override the $breadcrumb variable from your module using a preprocess hook? See http://drupal.org/node/173880 for more info.
2) Do you agree that Drupal's core breadcrumbs handling could be improved, to make it possible to have several sets of breadcrumbs (why not? A good themer could accommodate them easily), or at least to make it easier to override / complement each other's breadcrumbs.
If the new theme system in D6 doesn't provide enough flexibility, possibly. It's pretty awesome, though. -Angie
On Sunday 29 June 2008 18:14:17 Angela Byron wrote:
Augustin (Beginner) wrote:
1) how should I solve my particular problem (the timing of drupal_set_breadcrumb() in my module to override/enhance taxonomy's breadcrumbs).
Maybe override the $breadcrumb variable from your module using a preprocess hook? See http://drupal.org/node/173880 for more info.
If the new theme system in D6 doesn't provide enough flexibility, possibly. It's pretty awesome, though.
Using the theming system can be a temporary solution. I'll try that for a while. But using theming to override content is contrary to the guidelines, so we still need a long term solution. I follow up more on the issue. http://drupal.org/node/150854 A.
Anyone who is interested, and wants to weigh-in on a patch whether this needs a bug fix: http://drupal.org/node/73834 -Peter On Wed, Jul 2, 2008 at 5:16 AM, augustin (beginner) <drupal.beginner@wechange.org> wrote:
On Sunday 29 June 2008 18:14:17 Angela Byron wrote:
Augustin (Beginner) wrote:
1) how should I solve my particular problem (the timing of drupal_set_breadcrumb() in my module to override/enhance taxonomy's breadcrumbs).
Maybe override the $breadcrumb variable from your module using a preprocess hook? See http://drupal.org/node/173880 for more info.
If the new theme system in D6 doesn't provide enough flexibility, possibly. It's pretty awesome, though.
Using the theming system can be a temporary solution. I'll try that for a while. But using theming to override content is contrary to the guidelines, so we still need a long term solution.
I follow up more on the issue. http://drupal.org/node/150854
A.
participants (4)
-
Angela Byron -
augustin (beginner) -
Augustin (Beginner) -
Peter Wolanin