I'm submitting this in the spirit of contributing custom code to the community. A couple of years ago I started using Views to display Aggregator feeds for a project. We wanted to display nicer, human-readable URLs for the Views pages. So I developed an argument validation plugin for the Feed ID. The concept and some of the code were copied from views_plugin_argument_validate_taxonomy_term, though this Aggregator Feed plugin has fewer options. It has Feed ID and Feed title converted to Feed ID validators.

This code has been running since June 2013 on our website. You can see it working at http://fsrio.nal.usda.gov/research/publications. That is the main, aggregated feed. If you click on any of the journal title links in the view's header or in the feed items on that page, it will take you to that journal's feed page which uses the Feed title converted to Feed ID validator.

I should have contributed this plugin a while back. A recent need to update the custom module that provided this plugin caused me to remember to submit it.

In order to use it, you must:
1. Create an Aggregator feed. No special configuration should be necessary beyond adding the title, feed URL, and importing items.
2. Add a new view showing Aggregator items.
3. Add a contextual filter to the view, filtering on the Aggregator feed: Feed ID.
4. In the filter settings, specify the validation criteria to be an Aggregator feed for either the Feed ID or Feed title converted to Feed ID. The former will validate the numeric Feed ID in the URL and the latter will validate the title in the URL.

Again, it's basically the same steps that you would take to add a contextual filter for taxonomy term arguments.

This patch adds the argument validator plugin to Views 7.x-3.x.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dcam created an issue. See original summary.

dcam’s picture

Issue summary: View changes
dcam’s picture

Status: Active » Needs review
Chris Matthews’s picture

The 3 year old patch to aggregator.views.inc, views_plugin_argument_validate_aggregator_feed.inc and views.info does not apply to the latest views 7.x-3.x-dev and if still relevant needs to be rerolled.

Checking patch modules/aggregator.views.inc...
error: while searching for:
function aggregator_views_plugins() {
  return array(
    'module' => 'views', // This just tells our themes are elsewhere.
    'row' => array(
      'aggregator_rss' => array(
        'title' => t('Aggregator item'),

error: patch failed: modules/aggregator.views.inc:389
error: modules/aggregator.views.inc: patch does not apply

Checking patch modules/aggregator/views_plugin_argument_validate_aggregator_feed.inc...
Checking patch views.info...
Hunk #1 succeeded at 74 (offset 1 line).
Andrew Answer’s picture

Patch rerolled.