Skip to main content
added 5 characters in body
Source Link
resplin
  • 208
  • 1
  • 6

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['addon']['view$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?

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['addon']['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?

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?

Source Link
resplin
  • 208
  • 1
  • 6

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

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['addon']['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?