in my current configuration, when user click one aggregator news, the whole window will be replaced by news source link.
how to display the aggregator news content in one popup window or just one part of the whole window? otherwise the user will leave my website, go to others news site.

Thanks advantage

Comments

wysxs’s picture

IT's better to show the content of "aggregator news" in content window, not replace current whole window. somebody know how to do it?

Thanks

Sougent’s picture

Hi,

Change the code that creates the aggregator links to include a target="_blank" to the link.

Like this.....


Link to us!

Joe

jazzylee77’s picture

ver 4.6.3

would this be the code that creates the links? in aggregator.module

$output .= '<a href="/'. check_url($feed->link) .'">'. check_plain($feed->link) ."</a>\n";

I'm totally guessing. I've been trying to follow other suggestions on how to do this for days! I mostly want the rss block links to open in new windows.

I've been reading piles of blog entires and solutions for past versions and taking all kinds of stabs in the dark, fearful to ask again here for offending the purists!

surfdog’s picture

After going around in circles on this subject and my lack of formal training in PHP. I decided to give a stab at this just to rack my brain and also since I too would like to have this option and believe this should be a check box in aggregator configuration settings.

Anyways if you have aggregator.module,v 1.233.2.6 2005/07/03 16:09:12

You should find and be able to replace these two lines. Again I might be missing some syntax as I am a new be wannabe… But this does seem to be working out for me.

on line 1085

$output = '<a href="/'. check_url($item->link) .'">'. check_plain($item->title) .'</a> <span class="age">'. t('%age old', array('%age' => format_interval(time() - $item->timestamp))) .'';

changed to

$output = '<a href="/'. check_url($item->link) .'"target=\"_blank\">'. check_plain($item->title) .'</a> <span class="age">'. t('%age old', array('%age' => format_interval(time() - $item->timestamp))) .'</span>';

and on line 1109

$output .= ' <div class="title"><a href="/'. check_url($item->link) .'">'. check_plain($item->title) ."</a></div>\n";

changed to

$output .= ' <div class="title"><a href="/'. check_url($item->link) .'"target=\"_blank\">'. check_plain($item->title) ."</a></div>\n";

surfdog’s picture

Don't use dreamweaver to edit code!

Maniac8888’s picture

Hey, no problem. I think you are on the right track here. I too would like this. It is a proven fact that when visitors are redirected away from your site, they rarely come back.

surfdog’s picture

My mistake using dreamweaver to edit aggregator module added some extra code in module that created some funny errors. I was using this to get line numbers, Oh well I guess I won't be doing that again. .. Hope my post is helpful.

built on trial and error :)

Maniac8888’s picture

Good job! It works for me. Now if Aggregator2 would do this (the code is different but same concept should apply).

Thanks.

jazzylee77’s picture

I've been checking this thread every day. Can't wait to try it. I'd messed with this part of the code a couple times with no luck.

jazzylee77’s picture

I use aggregator blocks on most pages, so this is where to make them open in new windows as well.

on line 1070 "target=\"_blank\" goes in the same way.

$output .= '<a href="/'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";
change to
$output .= '<a href="/'. check_url($item->link) .'"target=\"_blank\">'. check_plain($item->title) ."</a>\n";