[support] custom breadcrumb question
Ray Zimmerman
rz10 at cornell.edu
Wed Sep 13 00:33:17 UTC 2006
I have a page (Articles & Reviews) that uses Views to display two
lists of nodes, tagged with the terms Articles and Reviews,
respectively. Currently, when viewing the individual nodes, the
breadcrumbs just show ...
Home
... but I'd like it to show ...
Home >> Resources >> Articles & Reviews
What is the best way to accomplish this?
In digging through some modules in core to get some ideas, I thought
the following approach might work. Create a new module that
implements a nodeapi hook for view, with something like ...
// if node has the "Articles" or "Reviews" taxonomy term (how do I
check for this?)
$breadcrumbs[] = l(t('Home'), NULL);
$breadcrumbs[] = l(t('Resources'), 'resources');
$breadcrumbs[] = l(t('Articles & Reviews'), 'resources/
articles_and_reviews');
drupal_set_breadcrumb($breadcrumbs);
$breadcrumb = theme('breadcrumb', drupal_get_breadcrumb());
Am on on the right track, or is there a better way?
Thanks,
Ray
More information about the support
mailing list