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
Comment #1
merlinofchaos commentedAnd if you turn offf the frontpage view and visit rss.xml I believe you will find the same behavior.
Comment #2
jordanmagnuson commentedThanks 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!
Comment #3
jordanmagnuson commentedFrom 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...
Comment #4
jordanmagnuson commentedSorry 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.
Comment #5
jordanmagnuson commentedAny help/ideas?
Comment #6
jordanmagnuson commentedNothing?
Comment #7
johnflower commentedI'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.
Comment #8
johnflower commentedTry http://thedrupalblog.com/displaying-teaser-view-field-your-view by Eric. This worked for me with a few changes.
Original code
After removing the if statement I got:-
print ' ' . l('> Read More', 'node/'.$row->nid);And that worked for me.
Comment #9
blauerberg commentedI think the problem caused because $node->readmore is not set.
Try this patch. This patch worked for me in Views 6.x-2.8.
Comment #10
dagmar@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.
Comment #11
blauerberg commented@dagmar
Thanks for replying and I'm sorry 1 spaces was my typo..
Comment #12
blauerberg commentedI attached patch for according to the coding standard.
Comment #13
merlinofchaos commentedNo, 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.
Comment #14
RagsToRich commentedI 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.
Comment #15
WeRockYourWeb.com commentedDid you try the Read More Tweak module? http://drupal.org/project/ed_readmore
Comment #16
RagsToRich commentedYes, see Teaser Feed Test
I am using Read More Link but no go... :|
Comment #17
geerlingguy commented@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...
Comment #18
jmuessig commentedsubscribe
Comment #19
blauerberg commented@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.
Comment #20
dawehnerThats how drupal core prepares the item.... It uses the full $item as $node.
So this makes sense here.
Comment #21
anonymous07 commentedsubscribe
Comment #22
Kafu commentedsubscribe
Comment #23
Kafu commentedPatch #19 worked for me in Views 6.x-2.10.
Comment #24
pjsz commentedPatch #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:
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
Comment #25
blauerberg commented@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.
Comment #26
merlinofchaos commentedCommitted to all branches. Thanks!
Comment #28
jamesoakleyShould 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?
Comment #29
blauerberg commentedRead 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().
Comment #30
Anonymous (not verified) commentedI'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?