Show breadcrumb when viewing nodes categorized with taxonomies included in the article view
ilo - August 27, 2009 - 01:36
| Project: | Article |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | msameer |
| Status: | needs review |
Description
After navigating through the Article tree, you finally reach a node. If you click the node link to view it, the breadcrumb gets lost. This patch will add an option in the settings to keep displaying the breadcrumb while vieweing the node. For me it's important from UI to don't get lost while reading content.
As a node could be tagged with several taxonomies, the breadcrumb will just show the article path of the first taxonomy ID listed as article.
| Attachment | Size |
|---|---|
| article_breadcrumb.patch | 1.71 KB |

#1
and again.. oops!
#2
mm I've found a problem here.. When searching for a node, there's no way to know if it's a teaser show or a full node view, and in fact, it's a 'search result', but a 'view' op is called in hook_nodeapi.
According to api: http://api.drupal.org/api/function/hook_nodeapi ,
$a3
* For "view", passes in the $teaser parameter from node_view().
But it's not true, and I can't find a way to know if it's a full node view to update the breadcrumb or not. If it's a search, the breadcrumb will be changed with each found node, what is not a good solution.. Need to fix this yet..
#3
mmm fixed.. instead of using 'view' op, we can use 'alter', that's definetively not used during searches. Although is used for listings, this one has populated the $a3 and $a4 values (I guess api documentation is wrong).. Updated the patch.
#4
Why not $a4 ? For "view", passes in the $page parameter from node_view().
Hadn't tried the patch itself yet.
#5
In the tests I did it didn't work.. I guess I was doing something wrong, because I just changed 'alter' to 'view' in the patch and it works. I had to have something messed up with the three patches I was releasing for the module. Sorry.
I have update the patch to use 'view' op of nodeapi.