Quantcast
Channel: drupal 7
Viewing all articles
Browse latest Browse all 19

Display Drupal menu local task tab according to node content type

$
0
0

By default every node should have the menu tab (MENU LOCAL TASK) of View and Edit.

If your module wants to add its own tab but only restricted to content type of "foo", then use the following code snippet.

XYZ below is your page callback for the new custom tab. Basically it calls another function to validate user's permission but we manipulate it to check the node type (via access callback).


Viewing all articles
Browse latest Browse all 19

Trending Articles