Quantcast
Channel: How to programmatically set custom display settings for an RSS feed? - Drupal Answers
Viewing all articles
Browse latest Browse all 2

How to programmatically set custom display settings for an RSS feed?

$
0
0

I am using Drupal 7 and Views 3.0-RC1.

I have defined an RSS feed for a view, but the full node content keeps showing up instead of the teaser. I believe it is because of these two issues:

The steps that appear to work are to:

  • Enable a custom display for RSS,
  • Configure the RSS custom display truncate the teaser and hide extra fields,
  • Enable the view to display full text for RSS.

I need to make this work programmatically as part of a features module.

The first step is easy. I do it with the following code in my .module file:

    function mymodule_entity_info_alter(&$entity_info) {
      $entity_info['customtype']['view modes']['rss'] = array (
        'label' => t('RSS Feed'),
        'custom settings' => TRUE,
      );

The last step is easy, as I can export the view.

The middle step has me stumped. I can't figure out how to set the display properties on the RSS display. I suspect it has something to do with field settings, but I can't seem to pull the pieces together. Any suggestions?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images