Can a Menu item be made to open in new tab or window?

Events happening in the community are now at Drupal community events on www.drupal.org.
Gmal-1's picture

Is it possible to have an individual menu heading open in a new window or tab?

If this is possible would it take major recoding, as I am a novice and that may be above my skill level.

Thank you for your input.

Comments

Do you just want a single

ksweet's picture

Do you just want a single menu item to have this functionality? If so I would think the easiest way would be to use jQuery to find the item and create a click event that opens in a new tab. Your other option is probably to implement hook_menu_item_link() and add in a target="_blank" on whichever menu items you want to have this.

Thanks for your help. I'll

Gmal-1's picture

Thanks for your help. I'll give it a try.

Use the options tag

rrrhal's picture

in hook_menu() add this line:

'options' => array('attributes' => array('target' => '_blank')),

to the array that defines the menu item.

OpenPublish

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: