Show feed name/link on feed items

kirkcaraway - August 8, 2006 - 06:09
Project:Aggregator2
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

It would be nice if each aggregated feed item (teaser and full) could instead of showing an author link, show the name and link of the site the item was aggregated from.

I really like this module. Opens up a whole new world of capabilities.

Thanks.

#1

unrev.org - August 9, 2006 - 15:37

This is a good point. I would also like to see an _option_ to have the node title itself link through to the original article. Sometimes people get upset about their site not getting proper credit... despite the "original author" link.

#2

fiLi - February 2, 2007 - 10:17

Just add it to your theme wherever you want this to show.
Something like (tested and works, but might not be optimal):

<?php
   
if ($node->type == 'aggregator2_item') {
        print
'<br /><small><a href="'. ($node->source_link ? $node->source_link : $node->link) .'" title="'. t('Read original article from') .' '. $node->feed_title .'">'. t('This article was aggregated from ') .' <strong>'. $node->feed_title .'</strong></a></small>';

    }
?>

I've also applied this to my feed, which is running Totalfeeds module.
I added the following buggy code to the function &_totalfeeds_prepare_item(&$node, $feedtype) :
    if ($item2->type == 'aggregator2_item') {
$feedItem->content = '<small><a href="'. ($item2->source_link ? $item2->source_link : $item2->link) .'" title="'. t('Read original article from') .' '. $item2->feed_title .'">'. t('This article was aggregated from ') .' <strong>'. $item2->feed_title .'</strong></a></small>' . $feedItem->content;
}

 
 

Drupal is a registered trademark of Dries Buytaert.