Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
linklist open in new window or tab
how do i get links generated by <txt:linklist> to open in a tab or window?
Offline
#2 2011-08-30 22:21:11
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: linklist open in new window or tab
Use linklist as a container tag or call a form with the form attribute, in your form or contained content use lower level link tags to build the url that behaves the way you would like, such as:
<a href="<txp:link_url />" target="_blank"><txp:link_name /></a>
not tested.
Offline
Re: linklist open in new window or tab
You could also use JavaScript to make links to external sites open in a new window:
$('a').each(function() {
var u= new RegExp('/' + window.location.host + '/');
if(!u.test(this.href)) {
$(this).click(function(event) {
event.preventDefault();
event.stopPropagation();
window.open(this.href, '_blank');
});
}
});
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: linklist open in new window or tab
thanks MattD and rsilletti. i was able to solve the problem.
Offline
Pages: 1