I'm stuck. I have a feed view set up using views_rss fields style, with Views 6.x-2.7. I have the fields title, body and posted date mapped to title, description and pubDate. But the output is completely unformatted as a feed (a single paragraph of plain text from the live preview and separate paragraphs from the actual feed) and consists only of the trimmed body text and the date. The title with the link to the node does not display at all. Any help would be appreciated.

Comments

chungyc’s picture

You probably want to map the URL to the node to the link element, not include it as a link in the title. The RSS specification is ambiguous about whether markup can be included in the title, so it's safer not to depend on it. Not to mention that it probably won't work with a lot of feed readers ...

As to how to get the node URL, there doesn't seem to be a clean solution, but rewriting the Node Nid is a quick and dirty solution (same issue is mentioned in http://drupal.org/node/585720)

droopy’s picture

Thanks. I mapped the url to the 'link element' and disabled the 'link this field to its node' option under node: title. But the title still does not show up in the feed output. The url is now there, along with trimmed body and post date, but not the title. The standard rss feed style works correctly, but the rss feed - fields style does not pick up the node title.

chungyc’s picture

That's odd, I'm surprised the title isn't showing up. Just in case, have you checked that you haven't unmapped the title field? If the title field is still mapped, then I'm stumped. Maybe posting the feed or a link to it might help with figuring out what's wrong; posting the exported view might be even better.

droopy’s picture

Hi.

I've included a sample of the output from the live preview of the feed followed by the feed section of the export.

You'll see that the output consists of the trimmed body, the url and the posted date. The title is missing, with or without the link.

http://www.postost.net   I mentioned this passage in the comment on Luke 13:22-24, but it is worth considering in its own right. First, as modern liberal interpreters we usually understand Jesus to be saying that the Galileans who died were not greater sinners than all other Galileans or that those who were crushed by...  http://www.postost.net/node/56 (11/17/2009 - 18:21)    Jesus is asked by a man in the street whether it is true that only a few will be saved. The question highlights the centrality of the theme of judgment on Israel in Jesus’ teaching, as it is found in statements such as: ‘I came to cast fire upon the land’ and ‘Do not think...  http://www.postost.net/node/51 (11/16/2009 - 14:29)   ...
$handler = $view->new_display('feed', 'Feed1', 'feed_1');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '[title]:',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'body' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 1,
      'max_length' => '300',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 1,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'body',
    'table' => 'node_revisions',
    'field' => 'body',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'nid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 1,
      'text' => 'http://www.postost.net/node/[nid]',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
  'created' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 1,
      'text' => '([created])',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'date_format' => 'small',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('style_plugin', 'rss_fields');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => array(
    'feed_description' => '',
  ),
  'fields' => array(
    'title' => 'title',
    'description' => 'body',
    'link' => 'nid',
    'author' => '',
    'category' => '',
    'guid' => '',
    'pubDate' => 'created',
  ),
  'georss' => array(
    'lat' => '',
    'lon' => '',
  ),
));
$handler->override_option('row_plugin', '');
$handler->override_option('row_options', array());
$handler->override_option('path', 'feed/all/rss.xml');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
$handler->override_option('displays', array(
  'default' => 'default',
  'page_1' => 0,
  'block_1' => 0,
  'page_2' => 0,
));
$handler->override_option('sitename_title', FALSE);
chungyc’s picture

This may be a silly question, but have you checked the actual feed rather than just the preview? I've just spent a lot of time trying to figure out why the title won't show up in the preview, and was just flabbergasted when the title shows up when actually accessed in a feed reader. The preview function for Views RSS appears to be broken. :/

droopy’s picture

No, I'd tried that - and tried it again. The feed itself is completely empty, presumably because it is not finding any titles. I also don't get the feed icons showing up. I tried creating a completely new view with only the views_rss styled feed and had the same problem. I had a look at views issues but couldn't see anything relevant there. I have a CCK content type in addition to standard stories but filtering out the CCK type made no difference.

I did find that the built-in rss feed does not work with preview but works from the url.

chungyc’s picture

If the default display shows rows of fields but the feed itself is completely empty of any content, then I don't have a clue what's wrong. Is there a URL you can provide for the feed?

As for the missing feed icon problem, it might be the same one as mentioned in http://drupal.org/node/585720

droopy’s picture

Hi - and thanks for sticking with this.

The url for the feed is: www.postost.net/feed/all/rss.xml

The weird thing is I have just discovered that in Firefox 3.0.15 it doesn't work but it's OK in Safari: I get the properly constructed feed with title and trimmed text.

But - if you look at the source of the feed in Firefox, the feed seems to be there.

On the other hand, if I edit the feed view in Safari, the live preview still doesn't work.

So basically I think I have the feed working, but there is a problem with the output in Firefox and with the live preview in Safari.

chungyc’s picture

OK, got what the problem is: HTML has to be escaped. You'll have to fix the code as explained in http://drupal.org/node/607622

Hopefully, this should finally give you a working feed. (Won't fix preview, though: that will need someone to code a proper render function for previews ...)

droopy’s picture

Right, that seems to have fixed it apart from the preview. Many thanks.

akongz’s picture

are this link of title can using path alias?

now I'm used static setting like bellow in field nid
http://www.example.com/node/[nid]

jmlavarenne’s picture

This is a simple method to use the path alias for the title :

Use the Custom Field module :
http://drupal.org/project/views_customfield

With this it's easy to set up a custom php field in the view.
Include the Node: nid field in your fields.
Create a custom field with the following code :

<?php
  echo 'http://YOUR_URL/' . drupal_lookup_path('alias', 'node/' . $data->nid);
?>

This way you will have your nice url path in the feed.

maciej.zgadzaj’s picture

Status: Active » Closed (fixed)

If this is still an issue, please try the most recent 6.x-1.x-dev version of the module (from 2011-Nov-09). D7 version to follow.

Also, please read the first draft of module documentation for what it can and can't do (and how).

Feel free to re-open this issue if needed.