Here's my problem. I want to aggregate comments from a number of different blogs and place them in a block I create with views. I want the block to use "list view". I want these comments to link directly to the original comment but right now (it seems) I'm unable to do that. I can add a "node title" to my view which points to the comment node created by FeedAPI but there's no way I can see to include a link to the original comment on the original blog post.

I know that using aggregator I can create a block where the items do link directly back to the original article -- but I need articles from a number of different feeds all to mash together in one block.

Setting the view type as "teaser" does work to some extent -- it has the link at the bottom "original article" -- but that's not very intuitive. Most people will just click on the title link and never see the "original article" link.

I'm really liking your work so far. FeedAPI has been a life saver for my website and I see several upcoming sites where it'll be very useful.

Comments

aron novak’s picture

I see two possible ways (both of them require a little coding):
- theming the views-created block (you can retrieve the original article url link from feedapi_node.module)
- extend aggregator with one block where all the feeds ' items can be found

kyle_mathews’s picture

Coding is not a problem, I think I'll theme the views block. It would be nice still to expose to views a node-title with the original url. I think what I'm wanting to do is a fairly common usecase for using an aggregator like feedapi.

Thanks for the suggestions!

jesss’s picture

How exactly would I retrieve the original article url link from feedapi_node.module?

It looks like the function I would need to use is feedapi_node_link, but I'm not sure of the syntax to properly invoke it. Can you give me an example?

joeboris’s picture

Subscribing

juliendorra’s picture

I wanted to do something similar.
It would surely be nice to have a "title with link to original article" filed exposed in Views by feedAPI

In the meantime, this comment gave me the tip on how to do it via theming : http://groups.drupal.org/node/7277#comment-22230

- I duplicated the node.tpl.php from my theme into my sub-theme

- I renamed it node-story.tpl.php as I only wanted this behavior on the Story content type
With this theming tip, you must not mix aggregated content and your site content in the same type -- your own site content would loose the link in the title. A more conditional code could allow the PHP to select the right link.

So, you may have to create another content type, let say "External Comments", and set-up The "Feed" content type to generate this kind of node. Note that you can have multiple master Feed type too (one for fetching comments in an External Comments type, another to fetch blog post...)

- I made the change explained in the comment, I quote : « replacing:

<h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
... with this:

<h2><a href="<?php print $node->links['feedapi_original']['href'] ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
»

- As a bonus, I added a rel="me" in the link tag, because I was pointing to my own post on another site. You may want to do the same if you use feedAPI to build your own "lifestream".

------

momper’s picture

subscribing

alanburke’s picture

subscribing...

I reckon there must be a way for a custom module to provide this item as a field to views.

Can't get my head around it though...

rodneyj’s picture

How would you make this work for Drupal 6?

print $node->links['feedapi_original']['href'] " title=" print $title "> print $title

This code does not produce the desired results. Basically when implemented the link reloads the existing page. I am using this for a customized search results page.

fletch11’s picture

Version: 5.x-1.0 » 6.x-1.x-dev
Component: Code » Code feedapi_node

I have been trying to figure this out as well... anyone else?

thanks

omerida’s picture

You can do this with VIEWS UI
1 - add FieldAPI url field to view, check to not display and sort above your Node title field
2 - rewrite title link, use [url] replacement. do not check 'link this field to its node'

sullyvon’s picture

In my applied theme directory...../var/www/html/sites/all/themes/acquia_slate

I have the following file node-view-linuxjournalview.tpl.php where "linuxjournalview" is the name of my view.

I did a hack for the title but I don't really like it, but it works for the Title....

$feeditem_url = db_result(db_query("SELECT url FROM feeds_node_item where nid = '$node->nid'"));

print $feeditem_url; " title=" print $title "> print $title

This is running with drupal 6.x

Now I'm trying to figure out how to remove the more link because it is a relative path, the relative part is correct, but it puts my hostname in front instead of where the real rss feed came from. I'd be happy with just removing it.