New-UDSideNavItem with Target option

(if this is already possible somehow, please point me in the right direction?)

I’d like to be able to specify -Url “address” -Target “new” or “self”, etc. so that external links (like Google, etc) open in a new tab or window, while pages within my app open in the same tab. Right now it seems every link opens in the same tab.

On the New-UDLink cmdlet there is an option ‘-OpenInNewWindow’. If the browser is set to open new Windows as a tab, then a new tab in the browser is opened. This may help.

1 Like

So instead of using -Url “address”, I should use -Content { New-UDLink … } ?

I think you could do something like this:

New-UDSideNavItem -Text 'Something' -OnClick { Invoke-UDRedirect -Url -OpenInNewWindow }
1 Like

omg - that small change works great - thank you! :slight_smile: