Add option to remove "View" and "Talk" tabs under node title
poakpong - April 25, 2009 - 18:03
| Project: | Talk |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Please suggest!
1. How to remove "View, Talk" tab under node, also use link "Add new comment" or "Talk page (1 comment)" (meta area in bottom of node) for go to Talk page?
(talk-remove-tab-1.png)
2. How to click on node title on Talk page for go back to Node page?
(talk-remove-tab-2.png)
Thank.
| Attachment | Size |
|---|---|
| talk-remove-tab-1.png | 45.67 KB |
| talk-remove-tab-2.png | 39.15 KB |

#1
+1. Displaying a talk tab could simply be one of two (or more) display options. There could also be a "back to node" link on the talk page.
#2
It's actually a bit of a problem to try to remove the tab :(
If we use MENU_CALLBACK as the menu type then the tab disappears, but when you go to node/NID/talk *all* of the tabs disappear because Drupal forgets where you are relative to the other menu items. If we could figure out a way keep those tabs, I think this could be a good solution.
If you just use an empty "title" value for the menu callback as a local task, then it displays as empty which helps to diminish the display, but frankly it just looks silly/ugly. On some browsers having an empty string as the link disappears (safari) but I don't think we should rely on that, exactly...
I'm not sure of a good way to fix this.
#3
After working on the access check I had a crazy idea on how to do this.
Attached patch makes it work, but it _does_ show the talk tab when on the "node/NID/talk" page. Does that still seem valuable? The reason it has to show the tab on that page is because of the results of the research in comment #2.