I'm working on a site with lots of news feeds. If a visitor clicks on one of the links it opens in the same window, taking them away from the site. I'm wanting it to open in a new window.

The Weblink module gives the option of allowing links to open in the same window or a new one. Has anybody got a suggestion of an easy way to do this with the aggregrator?

Thanks

Comments

mfr05’s picture

you must change the aggregator module.

you must change this

1147 $output .= "  <div class=\"title\"><a href=\"$item->link\">$item->title</a></div>\n";

into this

1147 $output .= "  <div class=\"title\"><a href=\"$item->link\" target=\"_blank\">$item->title</a></div>\n";
SimonP’s picture

Hi mfr05

Thanks for the suggestion.

It was line 1112 as I have an older version of the aggregator module:
/* $Id: aggregator.module,v 1.213.2.2 2004/10/29

But unfortunately it doesn't seem to make any difference to the behaviour of the links....

Thanks

Simon

====
Back in the UK after discovering drupal during temporary residence of Vancouver

SimonP’s picture

Hi mfr05

Apologies, it is working correctly.

If i'm looking at the list of feed items on page www.example.com/aggregator then you're right - they do now open in a new window.

I didn't explain properly, but i've got the feeds displayed in a right-hand block and these open in the same window. So i guess there's a similar line in the block.module that i need to amend - and i'm guessing that this will affect all links that appear in blocks....

Thanks again

Simon

====
Back in the UK after discovering drupal during temporary residence of Vancouver

shmatty29’s picture

Hi

I could not find the above line, but i did find this line.

line 901 $output .= 'link) .'">'. check_plain($item->title) ."\n";

and replaced it with

$output .= " link\" target=\"_blank\">$item->title\n";

and it worked perfectly

Thanks, Matt