Getting the aggregator items to go to a blank page

Member for

10 months 3 weeks
Submitted by AlReaud on Sat, 06/04/2011 - 19:18

The aggregator that comes default with Drupal outputs RSS links that don't open another tab or window. Sometimes it is preferable to have the links open in a new tab or window. That is accomplished by changing the called function in aggregator.module to add the tag target="_blank" to the anchor.

Open modules/aggregator/aggregator.module and change the text in function theme_aggregator_block_item to read:

function theme_aggregator_block_item($item, $feed = 0) {

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

}

Add new comment

The content of this field is kept private and will not be shown publicly.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol type start> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <u> <s> <sup> <sub> <hr>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Image CAPTCHA
Enter the characters shown in the image.