If there is a view displayed in the content area of a node, the taxonomy breadcrumb module does not show the breadcrumb of the node which is displayed on the page but of the last node, which is in the view. It seems that the taxonomy_breadcrumb_nodeapi is executed not only for the node which is to show on the page but also for every node which is in the view.
To get this fixed I enhanced the first line of the taxonomy_breadcrumb_nodeapi to check, if the node being processed is the one in the url. So I changed
if ($op == 'view' && $a4 && !drupal_is_front_page()) {
to
if ($op == 'view' && $a4 && !drupal_is_front_page() && arg(1) == $node->nid) {
For me this works fine. But I would like to ask if this is the right place to fix this or if it wouldn't be better to do a change so that the taxonomy_breadcrumb_nodeapi is only called for the page but not for the nodes of the view and how this could be done.
Comments
Comment #1
_craig CreditAttribution: _craig commentedInteresting solution. I like it.
Comment #2
_craig CreditAttribution: _craig commentedComment #3
smitty CreditAttribution: smitty commentedDid you commit this to a new version (I could't find any)? Or ist there another solution to this problem?
Comment #4
XanoWhat about this?
//edit: @ Smitty: This fix hasn't been committed yet to the latest dev version.
Comment #5
smitty CreditAttribution: smitty commentedThat's not working because in the view you display many nodes (teasers) on the page of the node, the breadcrumb is for. So for setting the breadcrumb you have to make sure, that you process the node of the page (and not the teasers of the view) ant that works only if the nid of the processed node is identical with arg(1).
Comment #6
MGN CreditAttribution: MGN commentedWhat is the consensus on this? It seems like the original fix should be committed to dev. Please let me know if there are other ideas on this.
Comment #7
smitty CreditAttribution: smitty commentedThat's my opinion too.
Comment #8
zlex CreditAttribution: zlex commentedWorked for me
Comment #9
MGN CreditAttribution: MGN commentedComment #10
MGN CreditAttribution: MGN commentedCommitted to 5.x-1.x-dev branch.
Comment #12
Xano