Different Views/Pages for Different Feed Sources

LarryTX - December 4, 2008 - 18:42
Project:Aggregation
Version:6.x-1.3
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

This is probably yet another dumb question. I want to pull feeds from several different sources on my site. Unlike many of the other issues posted here, I'm not concerned about separating out articles in the feeds by category. What is important to me is the source of the feed. I would like to have each source show up as a separate menu item, each with its own view or page. At this point, if I add multiple sources, the feed items all end up jumbled together. Is there anyway to maintain separate feeds?

#1

_Sack_ - November 6, 2009 - 03:07

Hi, not sure if you're figured this one out but I had the same problem.

I've come up with a solution that works, although I don't know if it's the best solution but I am yet to find any alternative.

First of all, in the feed items, there is a variable ($node->fid) that stores the nid of the parent feed. So, if we can filter on that variable, problem solved. However, Views has no way to filter on that variable in it's default filters, neither can we with arguments or relationships. So, we need to make a custom cck field that will grab the fid when the feed item is created.

I installed the Computed Field module that lets you add a custom "computed field" to your content types. After installing the module, I added field_parent_feed field to the feed item content type. I then used the 'Computed Code':
$node_field[0]['value'] = $node->fid;

Remember to change the 'Display' of this field all to hidden although keep it visible for testing.

Now, I can go into views and filter on this field, you just need to know the nid of your parent Feed.

 
 

Drupal is a registered trademark of Dries Buytaert.