I have a PowerShell Script that can build a 3-level Menu SharePoint 2013 MetaNavigation Menu of Links and Labels. The menu is driven by a CSV file with 4 entries: First-level Label, Second-Level Label, Third-Level Label and a URL.

I want to add 3 additional indicators as to whether the url should be opened in a new window or not.

Now the problem: I can probably store the indicators in custom fields--haven't really checked this out yet. I'm not sure of what I will need to do with jquery or javascript to utlilize the information and act on it--to open the url in a new window.

I've already tried to jerry-rig a javascript window open statement in the Url and that won't work.

Has anyone done any intercepting of the Navigational Metadata Urls? The jquery or Javascript to access the urls as they are being used in the menu.


If the links are contained in standard < a > anchor tags, then you can just use the target attribute to control how they open. You can iterate the links and modify this attribute with jQuery.

  • I'm not constructing the anchor tag. I'm entering a url into the Metadata Term Store. – user10711 Jan 29 '14 at 19:26

Sure I've done this.

Our site uses managed navigation, and as far as I can tell there is no out of the box manner to have a new window pop open without writing some custom code.

Here is the method I used to open a link I created on the navigation bar into a new window:

jQuery("a[href='example.com']").click(function(){window.open(this.href, "", "width = 1100, height = 1300"); return false;});

Just put the web address you want to open in a new window in place of 'example.com'. You can put this in a .js file that you reference in the master page and then every page following the master should have it as well.

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.