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.

AttachmentSize
article_breadcrumb.patch1.71 KB

#1

ilo - August 27, 2009 - 01:36
Status:active» needs review

and again.. oops!

#2

ilo - August 27, 2009 - 02:09
Status:needs review» needs work

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

ilo - August 27, 2009 - 02:20
Status:needs work» needs review

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.

AttachmentSize
article_breadcrumb_1.patch 1.78 KB

#4

msameer - August 29, 2009 - 10:03
Assigned to:Anonymous» msameer
Status:needs review» needs work

Why not $a4 ? For "view", passes in the $page parameter from node_view().

Hadn't tried the patch itself yet.

#5

ilo - August 29, 2009 - 17:45
Status:needs work» needs review

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.

AttachmentSize
article_breadcrumb_2.patch 1.78 KB
 
 

Drupal is a registered trademark of Dries Buytaert.