I'm using a lot of feeds from Bloggers around China in my site (or rather I will when I'm finished rebuilding it.)

Is there a way I can make those links open to a NEW page? I don't want to lose my viewers to other sites that easily, but I also want to cross-promote with other expat websites.

Example is here: http://www.chinaexcursions.com/shanghai

I'm syndicating Shanghaiist & Shanghai Expat. Any clicks go to their site, and leave mine. Would rather keep my users looking around my pages.

Cheers!

Eric

Comments

fuzzy_texan’s picture

I wouldn't mind knowing this one too.

tm’s picture

not sure if the external links module would work for you; you may have to try different settings combinations.

Seneschall’s picture

Somehow, and I'm still in awe of this... I managed to get the block links to open in new windows, and best of all, I DIDN'T Destroy my site!!!

Open up aggrigator.module and look for lines 1331 & 1332. Back it up first before yo make the change below. You're basically just adding a 'target="_blank"' to the 'a' command.

Original:

 // Display the external link to the item.
  $output .= '<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";

Replace with:

  // Display the external link to the item.
  $output .= '<a target= "_blank" href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";
Seneschall’s picture

Do the same on line 1347 for links on Categories view to open up to their news source on a separate page.

Do the same on line 1374 for TITLES to open up their news sources on a separate page.

Haven't figured out the links inside the articles yet. They still open up in the main page.

Also, I haven't tested this out that much. All I know is that it works on MY SITE. If it destroys your site, punch a cushion, not me. ;)

Cheers!

Eric

tm’s picture

glad you found a solution that satisfies you, but be aware of "best practices" when touching core modules. i am not saying "don't do it" (others might), just be careful.

good luck!

Seneschall’s picture

As for the core module, so far, the change has been minor, and had no ill effects on the site as far as what I can see. I'll have a read through on the best practices page.

Perhaps I've spent too long tearing apart mdpro mods for a few years and to me it just seems natural to carve out the insides & replace them with customized code.

Cheers

Eric