Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hello
when creating a view of type node -> feed -> rss, and setting row style to Fields and not content, the RSS feed picks up by default the Content: Link for Link in the RSS settings.
the problem is, Content: Link is outputed as formatted HTML
<a href="abc">my title</a>
alas, if we try to enable strip HTML tags from this field, it basically... does nothing. the HTML is still included.
this results in an output produced by views (for this kind of RSS), which is always broken
can Strip HTML be fixed for Content: Link?
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThat's true, I had the same issue. A solution for me was to display the whole content instead of fields. The RSS plugin then seems to handle that properly.
Another solution could be to construct the URL manually by rewriting the output to something like "node/[content:nid]" (perhaps worth a try, but I didn't try myself).
Comment #2
Yura Filimonov CreditAttribution: Yura Filimonov commentedConfirming this, have the same problem on fresh install, was just trying to configure RSS feed output with "Fields" row styling, having read that the other option uses too much resources.
I was only having tags in the title and the link.
To remove tags from the title, here's what I did:
In the View display settings (such as "Feed"), in the Title field settings unchecked "Link this field to the original piece of content". Also, in the same window, in the "Style settings" unchecked "Add default classes".
Still digging in the link.
Comment #3
kpaxman CreditAttribution: kpaxman commentedLooks like "link" should be set to use Content: Path, rewritten to use an absolute link.
Comment #4
joelcollinsdc CreditAttribution: joelcollinsdc commentedThis is a really annoying bug. Please fix this. It should not be this difficult to make a rss field with links.
Comment #5
joelcollinsdc CreditAttribution: joelcollinsdc commentedFWIW, this is how i fixed this ( i coudln't use a theme function, so it was even more obtuse...)
+function mymodule_theme_registry_alter(&$theme_registry) {
+ $theme_registry['views_view_row_rss']['preprocess functions'][] = 'mymodule_preprocess_views_row_rss';
+}
+
+function mymodule_preprocess_views_row_rss(&$vars) {
+ //see http://drupal.org/node/1780196
+ $vars['link'] = str_replace('%3Ca%20href%3D%22/', '', $vars['link']);
+ $vars['link'] = str_replace('%22%3Eview%3C/a%3E', '', $vars['link']);
+}
Comment #6
tropicfruit CreditAttribution: tropicfruit commentedSeems this is caused when views tries to link the field back to its content. At least in my feed display the checkbox was filled accordingly by default.
Too fix this, just go to "your view" > "your feed display" > Fields > Title > Uncheck "Link this field to the original piece of content".
Comment #7
czigor CreditAttribution: czigor commentedThe RSS field options form says for the Link field: "This must be a drupal relative path."
So as stated in #3, you should use Content:Path, not Content:Link and it works as it should.
Comment #8
joshuautley CreditAttribution: joshuautley commented#3 worked for me. Rewrite as absolute in views for the feed Title.
Comment #9
UksusoFF CreditAttribution: UksusoFF commentedI'm have this problem on 7.x-3.8
I've try add Content:Path instead of Content:Link but it's give only front page link, not node.
Comment #10
peterg.griffin CreditAttribution: peterg.griffin commentedContent: Path worked fine for me. No need to use the absolute path as views feed link settings seems to add the domain by itself.
Comment #11
neuquen CreditAttribution: neuquen commented#3 worked for me as well.