Page 1 of 1

How to open all links in new windows/content rewriter plugin

Posted: Mon Jun 14, 2004 12:16 pm
by Sam
Hello,

I just do not know how to enable the content rewriter plugin to rewrite all links which look like
<a href="http://url">Click me!</a>
to
<a href="http://url" target="_blank">Click me!</a>
Does anybody know how to?

Re: How to open all links in new windows/content rewriter pl

Posted: Mon Jun 14, 2004 2:09 pm
by garvinhicking
Hi Sam!

That wouldn't work with the content rewrite; it is used with fixed string replacement, what you are looking for would need to match regular expressions.

I instead suggest you to look at the 'trackexits' event plugin, this one already rewrites URL. You could adapt it to not encode the exit link, and instead pass the original link through and just expand it to include the 'target' attribute.

Regards,
Garvin.

Re: How to open all links in new windows/content rewriter pl

Posted: Mon Jun 14, 2004 5:07 pm
by Sam
garvinhicking wrote: I instead suggest you to look at the 'trackexits' event plugin, this one already rewrites URL. You could adapt it to not encode the exit link, and instead pass the original link through and just expand it to include the 'target' attribute.
I'm using this plugin already, so it wasn't a big problem to include the 'target="_blank"' in _encodeExitsCallback. Thanks!