Loading...
 
Skip to main content

History: How to make menu items open in a new window

Source of version: 6 (current)

Copy to clipboard
            !How to make menu items open in a new window.

This method uses some jquery. There is an alternative method described at ((Menu|#External_Links_in_Menus))

Insert the following code at the bottom of templates/footer.tpl (which is a convenient place to put it).

The option item that you want to open in a new window in the following example is 1318, corresponding to option ID 1318 in admin {FONT(size=14)}((menus)){FONT}

{CODE()}
{jq}
$('.option1318 a').click( function() {
window.open( $(this).attr('href') );
return false;
});
{/jq}
{CODE}

You can specify multiple options to be affected as follows (in this case option 1315 and 1318)

{CODE()}
{jq}
$('.option1318 a,.option1318 a').click( function() {
window.open( $(this).attr('href') );
return false;
});
{/jq}
{CODE}