Reputation:
How can I open all Sitecore external general links in a New Browser tab/window by default? And how can I force them to have just a New Browser option when I press Insert External Link.
Upvotes: 1
Views: 3203
Reputation: 150
If you just want to remove the target="Active Browser" attribute from all links:
$('a[target="Active Browser"]').removeAttr('target');
Upvotes: 0
Reputation: 4410
If you already have external links on your website and you don't want to have to edit all of the existing ones, you can also do this with a bit of jQuery:
jQuery(function($) {
$('a[href^="http://"],a[href^="https://"]')
.not('[href*="mydomain.com"]')
.click(function(e) {
var url = this.href;
e.preventDefault();
window.open(url);
})
});
Upvotes: 1
Reputation:
You need to modify next file :
\Website\sitecore\shell\Applications\Dialogs\ExternalLink\ExternalLink.xml
You have in file :
<Combobox ID="Target" GridPanel.Width="100%" Width="100%" Change="OnListboxChanged">
<ListItem Value="Self" Header="Active browser"/>
<ListItem Value="New" Header="New browser"/>
<ListItem Value="Custom" Header="Custom"/>
</Combobox>
You can delete first and last ListItem from Combobox.
Please copy first time ExternalLink.xml to : \web\sitecore\shell\Override\ folder and after modify file .
Upvotes: 2