I've searched the views rss issues, but could not directly find an explanation.
I have a content type, which has the following two fields for teaser:
(admin/structure/types/manage/chart/display/teaser)
- a thumbnail (Image style: square_thumb_crop, linked to content)
- teaser-text (plain text)
I want to create an RSS feed that contains, per entry, a title, that thumbnail and teaser text. So I've set my settings to:
Format: RSS Feed | Settings
Show: Content | Title plus teaser
However, whatever I do, it seems to grab the full node/default display content. (Title, teaser-text, a field that holds flash embed, and so forth - and not the thumbnail (which is set to hidden on default node display.)
The xml feed would be used to pass on to another site, which would use the title, thumbnail and teaser text to link back to us. So giving them a 'default display feed' (without the thumbnails) is no use.. .
Any help/hint would be greatly appreciated.
Comment | File | Size | Author |
---|---|---|---|
#25 | rss_feed_1301788_25.patch | 2.92 KB | scito |
#17 | rss-view-modes-1301788.patch | 2.66 KB | dawehner |
#11 | rss-view-modes-1301788.patch | 2.42 KB | JeremyFrench |
Comments
Comment #1
vint CreditAttribution: vint commentedComment #2
vint CreditAttribution: vint commentedSolved locally by using Display Suite ( http://drupal.org/project/ds ) to change the output of the default RSS for that node-type. Still not sure if this is how it is supposed to be done / why it never grabbed the 'teaser' display correctly.
Comment #3
renat CreditAttribution: renat commentedConfirm this problem with 7.x-3.x-dev (2011-Oct-15).
Comment #4
resplin CreditAttribution: resplin commentedI also see this problem with Drupal 7.7 and 7.x-3.0-rc1. Views appears to ignore the teaser configuration and populates the template's $description with the full node contents. However setting it to Title-only works, so only the teaser is affected.
Comment #5
resplin CreditAttribution: resplin commentedJeremyFrench found a solution for me.
There is no code for the title plus teaser in views, but it does a node_build_content($node, 'rss').
We defined a custom display for our content type:
* Structure -> Content Types -> Manage Displays
* Under "Custom Display Settings" select "RSS"
* Then configure your RSS display to only show the Description as "Summary or trimmed".
* Under Views -> Feed -> Format -> Show, select "Full text"
It should now show your RSS custom display setting.
The process is pretty clean, it is just that the interface is misleading on this topic.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedThings have changed here from D6 to D7, and I believe even core has a bug here because it still has a setting that is not actually respected. It's going to take some effort to figure out the right way to do this going forward, but it appears that resplin has posted an acceptable workaround for the moment.
Comment #7
renat CreditAttribution: renat commentedConfirm, workaround from #5 works very well. Thank you, JeremyFrench and resplin.
Comment #8
bobthebuilder CreditAttribution: bobthebuilder commentedresplin workaround worked for me, however, now I'm not able to get Full Text to work since the View is using the RSS version of the node. I need to build a Head Only, Teaser, and Full Text rss feed for a particular node. From what I've gathered, I have to choose between Teaser and Full Text. Or am I missing something here?
Comment #9
resplin CreditAttribution: resplin commentedAccidentally posted twice.
Comment #10
resplin CreditAttribution: resplin commentedI used field display, and in the settings configured two views of content, one which I truncated like a teaser and one which I left full-length. I did this because I didn't see a Teaser field.
This is not a good solution because if a node has a summary it will be ignored. But it is the best I could find.
It looks like a teaser field was added in D6, but I don't see it in D7. I thought I found an issue about this earlier, so I didn't report it, but I can't find it now.
Comment #11
JeremyFrench CreditAttribution: JeremyFrench commentedI've attached a patch.
In D6 'title + teaser' made sense as there was always a body field from which you could deduce a teaser. In D7, nodes don't have to have a body, or can have multiple fields which work like a body.
Display modes are used in D7 to allow for different views, the default display modes defined in the node module are 'full', 'teaser' and 'rss'.
I have updated the options drop down to clarify this, and changed the code so that it will use the mode selected. Title only also still works and makes sense as nodes do still have a title.
I also changed
$item_length
in the code to be$display_mode
as$item_length
didn't really make sense. I kept the view setting with this name to preserve backward compatibility.@merlin, I couldn't find a core issue for this if you can point me at it I can patch there too.
RSS namespaces were a bit of a quandry. In RSS mode
$node->rss_namespaces
may be populated, so I used this, if this isn't populated I use the defaultrdf_get_namespaces(),
I figured that too many namespaces was better than too few (which would be invalid)Comment #12
Kevin Morse CreditAttribution: Kevin Morse commentedNot sure if it's helpful but with 7.x-3.0-rc1 my View appears to respect turning off and on most fields in addition to displaying Labels by using the Manage Display / RSS option.
The problem I'm having is that I can't seem to turn off display of the Language English, regardless of what the Manage display / RSS options say.
This is also being discussed at http://drupal.org/node/1209478 I'm not sure if these issues are both related or not but it kind of seems so. If it isn't I apologize for any misdirection.
Update: Here is an example from a feed on one of my sites. After HTML is stripped it looks like this:
Notice the Language English as well as the links to the three other languages. The RSS feed is basically useless right now unless I can filter that out on my main site or on the other Drupal sites which I would like to have aggregating this feed.
Comment #13
JeremyFrench CreditAttribution: JeremyFrench commentedHi Kevin. Looking at the issue #1209478: Language in RSS description still visible after hiding it may be related to this. At least in the initial description.
The default rss settings are 'teaser' if no variable is set, so if your teaser view has the language display being shown it could be the cause. (it looks like there may be other issues going on there as well).
Did you want to try out my patch from #11 and see if it helps you at all?
Comment #14
selcuk_erdem CreditAttribution: selcuk_erdem commentedThe RSS feed is basically useless right now unless I can filter that out on my main site or on the other Drupal sites which I would like to have uydunet aggregating this feed.
Comment #15
JeremyFrench CreditAttribution: JeremyFrench commented@selcuk_erdem, this issue is marked as 'needs review' which means there is a patch available which may resolve it. You could help Drupal by testing this patch to see if it resolves the issue for you.
There is a work around as well (See #5).
If either of these things is not working for you, please could you state why, and the community may be able help resolve the issue.
Comment #16
merlinofchaos CreditAttribution: merlinofchaos commentedOn the patch: I believe we can fetch a list of view modes rather than hardcoding the available modes. Otherwise this seems like the best solution. If you can modify it like that I believe it can be committed.
Comment #17
dawehnerCan you please explain this change? This seems to be slighly unrelated to this issue.
I like the new name of the variable!
Okay so i implemented this general fetching of the build modes, and simplified some parts of the code.
Comment #18
JeremyFrench CreditAttribution: JeremyFrench commentedThanks for the tidy up. The only thing which may have been missed is that some views may have a length of "fulltext"prior to this patch. I'm not sure how they will be displayed as that isn't a valid display mode.
The rdf line is to try to keep the xml valid. I think if you didn't include it. There could be namespaces in the feed which are not declared.
Comment #19
dawehnerOh i wrote some kind of conversion code:
Comment #20
JeremyFrench CreditAttribution: JeremyFrench commentedSorry, shoudn't have looked at the patch last thing at night. Full text thing is fine.
Did a bit of testing re the namespace thing. At the moment everything is put as escaped html into the description field. I have no idea how different user agents respect namespaces in the rendered markup, it it won't make the rss invalid xml in any case. So we don't need to worry about it.
I'm happy with the patch as it stands, but as it is based on mine I won't RBTC it.
Comment #21
dawehnerYou know the reality shows that in all queues beside drupal core waiting for someone testing or reviewing a patch is pretty hopeless.
@dereine
Add the rdf namespace part and commit it
Comment #22
renat CreditAttribution: renat commentedPatch from #17 works well for me. Thank you for fixing this problem!
Comment #23
Kevin Morse CreditAttribution: Kevin Morse commentedWhich patch should I be testing? The one from #17 or the one from #11? I'm assuming #17 is just an improvement?
Comment #24
JeremyFrench CreditAttribution: JeremyFrench commented#17 is better, pulls in the display types rather than hard coding.
Comment #25
scito$view
should be&$view
for PHP 5.3. If this is not the case, a strict warning is shown.Warning:
Additionally, I've added the rdf namespace part as of comment #21.
Comment #26
Kevin Morse CreditAttribution: Kevin Morse commentedFinally duplicated the production site with the RSS feed, figured out how to apply git patches, duplicated the RSS client site and discovered my issue has been fixed in one of the recent updates I've done. Thanks all for your time and the hard work you put into developing this module.
Comment #27
marktheshark CreditAttribution: marktheshark commentedAlso in need of a way to have the RSS feed use the teaser instead of the full node. Following...
Comment #28
dawehnerSo this patch looks fine and works fine for a simple node_rss view, so committed it.
Comment #29.0
(not verified) CreditAttribution: commentedThe more I try to resolve / work around this. The more I become convince it is a bug (as it does not grab the info it says it would), rather than an error on my side. But don't seem to be able to change status?