Okay, so here's my website's front page view: http://www.necessarygames.com
And here's my front page view-based rss feed: http://www.necessarygames.com/rss.xml

As you can see, the teasers are displayed on my front page with "read more" links, but the rss feed contains no such links. When I preview the rss display in views the "read more" links are there, but when I go to the actual feed they're gone. Any help is very much appreciated.

Here is an export of the view:

$view = new view;
$view->name = 'frontpage';
$view->description = 'Emulates the default Drupal front page; you may set the default home page path to this view to make it your front page.';
$view->tag = 'default';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('sorts', array(
  'sticky' => array(
    'id' => 'sticky',
    'table' => 'node',
    'field' => 'sticky',
    'order' => 'DESC',
  ),
  'created' => array(
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'order' => 'DESC',
    'relationship' => 'none',
    'granularity' => 'second',
  ),
));
$handler->override_option('filters', array(
  'promote' => array(
    'id' => 'promote',
    'table' => 'node',
    'field' => 'promote',
    'operator' => '=',
    'value' => '1',
    'group' => 0,
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
  ),
  'status' => array(
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'operator' => '=',
    'value' => '1',
    'group' => 0,
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
  'role' => array(),
  'perm' => '',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('header_format', '1');
$handler->override_option('footer_format', '1');
$handler->override_option('empty_format', '1');
$handler->override_option('use_pager', '1');
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'relationship' => 'none',
  'build_mode' => 'teaser',
  'links' => 1,
  'comments' => 0,
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'frontpage');
$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 = $view->new_display('feed', 'Feed', 'feed');
$handler->override_option('title', 'Front page feed');
$handler->override_option('style_plugin', 'rss');
$handler->override_option('style_options', array(
  'mission_description' => 1,
  'description' => '',
));
$handler->override_option('row_plugin', 'node_rss');
$handler->override_option('row_options', array(
  'relationship' => 'none',
  'item_length' => 'default',
));
$handler->override_option('path', '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' => 'page',
));
$handler->override_option('sitename_title', '1');

Comments

merlinofchaos’s picture

Status: Active » Closed (works as designed)

And if you turn offf the frontpage view and visit rss.xml I believe you will find the same behavior.

jordanmagnuson’s picture

Status: Closed (works as designed) » Active

Thanks for the quick reply merlinofchaos. First of all, thanks for what is needless to say one of the greatest modules ever, and second, thanks for your tireless and timely support for people like me who are not drupal experts.

I'm a bit confused about the "read more" issue though... I turned off views and you were correct: my default rss display has no read more links present. Is this really the intended default behavior? Before posting this question I was reading stuff all over the internet, and I was under the impression that drupal DID now include read more links in rss... for example:

http://drupal.org/node/3493
http://drupal.org/node/119749
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/...
http://groups.drupal.org/node/16181

So like I said, I'm confused, and just want to double check what the default behavior is supposed to be. If the read more link is indeed NOT supposed to show by default, how can I get it to show up?

Thanks again for your help!

jordanmagnuson’s picture

From what I can tell of this code, it looks like the "read more" link is indeed supposed to show up in rss feeds:

http://api.drupal.org/api/function/node_feed/6

Am I right? If so, I am stumped as to why no read more links are showing up for me...

jordanmagnuson’s picture

Sorry merlin: I made a mistake earlier. I tested my site again after disabling views, and the read more link DOES show up in my feed. Only after I enable views (and thus displace the default feed with the views feed) does the read more link disappear.

jordanmagnuson’s picture

Any help/ideas?

jordanmagnuson’s picture

Nothing?

johnflower’s picture

I'm also wanting Read More links in my Views feeds. I can get them if I chose Row Style=Node, but I want Row Style=Fields.

johnflower’s picture

Try http://thedrupalblog.com/displaying-teaser-view-field-your-view by Eric. This worked for me with a few changes.

Original code

 if ($teaser!=$output) {
  print ' ' . l('> Read More', 'node/'.$row->nid);
}

After removing the if statement I got:-
print ' ' . l('> Read More', 'node/'.$row->nid);
And that worked for me.

blauerberg’s picture

StatusFileSize
new879 bytes

I think the problem caused because $node->readmore is not set.
Try this patch. This patch worked for me in Views 6.x-2.8.

dagmar’s picture

Version: 6.x-2.6 » 6.x-2.x-dev
Category: support » bug
Status: Active » Needs work

@baluerberg: Looks good, I didn't test it yet, some tips from http://drupal.org/coding-standards

Replace $readmore by $read_more, and add 2 spaces (and use spaces for identation) to the identation of the code inside the if.

+      if ($teaser) {
+        $read_more = $node->teaser != $node->body;
+      }
blauerberg’s picture

@dagmar

Thanks for replying and I'm sorry 1 spaces was my typo..

blauerberg’s picture

StatusFileSize
new888 bytes

I attached patch for according to the coding standard.

merlinofchaos’s picture

No, we should not be setting the readmore link manually. This is set by node_prepare which is called by node_build_content which is called by node_view which is how we create the teaser.

If core is not adding the readmore flag, then maybe we're calling node_view() wrong but that seems really odd to me.

RagsToRich’s picture

I also have this problem.

See http://www.therealmind.com/ where Read More displays fine...

and http://www.therealmind.com/blog/feed where it does not show at all...

The suggested fixes here are a little too nitty-gritty for me so I'll wait for a fix.

WeRockYourWeb.com’s picture

Did you try the Read More Tweak module? http://drupal.org/project/ed_readmore

RagsToRich’s picture

Yes, see Teaser Feed Test

I am using Read More Link but no go... :|

geerlingguy’s picture

@Merlin / #13 - I'm having this trouble too... For some reason, the readmore flag is not set on any of my nodes, even if the teaser ≠ the body...

jmuessig’s picture

subscribe

blauerberg’s picture

StatusFileSize
new659 bytes

@merlinofchaos

thanks for your advice and I got the wrong idea.

$node->readmore is set correctly in node_prepare(), but $item->nid and $item->readmore is not set.
I fixed my patch and worked in Views 6.x-2.9.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community
      // Filter and prepare node teaser
      if (node_hook($item, 'view')) {
        $item = node_invoke($item, 'view', $teaser, FALSE);
      }
      else {
        $item = node_prepare($item, $teaser);
      }

      // Allow modules to change $node->content before the node is rendered.
      node_invoke_nodeapi($item, 'view', $teaser, FALSE);

Thats how drupal core prepares the item.... It uses the full $item as $node.
So this makes sense here.

anonymous07’s picture

subscribe

Kafu’s picture

subscribe

Kafu’s picture

Patch #19 worked for me in Views 6.x-2.10.

pjsz’s picture

Patch #19 did not work for me .

But i finally just added a link to my views-view-row-rss.tpl.php in the description tag right before its closing tag:

print '<div class="readmore"> <readmore> <a href="' . $link . '"> Read more ... </a> </readmore> </div>';

Finally I'm getting a Read more link in Google Reader. Safari always displays the
tag as Read More. So there, i have two. Great. But I can live with that.

Now, I add my rss.css file to top of views-view-rss.tpl.php so i can format that div how i want. Right after your initial <?xml version="1.0" ... ?> put something like

<?xml-stylesheet type="text/css" href="http://you.com/rss.css" ?>;
blauerberg’s picture

@pjsz

What version of Views are you using?
Would you tell me more details of "did not work"?
If node's body is shorter than own teaser, link of "Read more" is not appeared, and it is correct.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed to all branches. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jamesoakley’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Active

Should I open a new issue or re-open this one? Apologies if I jumped the wrong way.

Since upgrading a site to Drupal 7, I've noticed that the Read More links have vanished from my RSS feeds. There doesn't seem to be an equivalent to the extra lines at patch #19 in 7.x-3.3, or at least, specifically $item->readmore is not set anywhere in that .inc file. I've tried adding that one line at the relevant point, but it didn't seem to solve it.

Is that a separate issue, or does some kind of similar patch need applying to 7.x-3.x?

blauerberg’s picture

Read more links is only generated by node_build_content() when $view_mode = 'teaser'.
In other $view_mode ('rss' or other), you can add links by hook_node_view().

Anonymous’s picture

I'm sorry, I can't understand #29. Are you saying that one needs to write a custom module in order to get the read more link?