Views menu tab displayed on only certain content types.

Profile picture for user Phil Frilling
By Phil Frilling, 10 July, 2012
I recently ran into an issue where I wanted to use a views page as a tab for nodes of type 'course'. I added the view page like normal, providing my path of: node/%/course-list. Next, I added my menu item entry as a 'menu tab'. Perfect, except that the menu tab was displaying on every node when I needed it to only display on one node type.

The solution

To allow this menu tab to only display on nodes of type 'course', I added a node id 'contextual filter'. Then, in the 'when the filter value is in the url or a default is provided' area, I checked 'specify a validation criteria'. Then I set the 'validator' to 'content'. Then I chose the 'course' content type. Voila, everything works perfectly.