Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-20 19:59:48

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

open in new window

Is there a way to make the comment name that is linked to open in a new window?


<txp:Ruhh />

Offline

#2 2008-04-20 21:33:47

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: open in new window

you could easily do this with jQuery… assuming the link is somewhere in a div that has a class comment it would be:

		<script type="text/javascript">
			$(document).ready(function(){
				$(".comment a").attr('target', '_blank');
			});
		</script>

Offline

#3 2008-04-20 21:42:05

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: open in new window

Where would I put that snippet in?


<txp:Ruhh />

Offline

#4 2008-04-21 06:24:36

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: open in new window

somewhere in your page template. don’t forget to load jQuery, there is already one included in textpattern which you could call that way:

<script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>

Offline

#5 2008-04-21 07:34:55

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: open in new window

And call of jquery must me before your function, like this:

<script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(".comment a").attr('target', '_blank');
});
</script>

Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#6 2008-04-21 07:50:24

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: open in new window

thanks! :)


<txp:Ruhh />

Offline

Board footer

Powered by FluxBB