2
  1. I want to disable the default Drupal 7 RSS feeds located at /rss.xml. Can this be achieved?

  2. I want to create my own custom RSS feeds. I have tried with the Views module, but I can't define my own fields, and default feed contains a lot of HTML etc. I just want to create a clean RSS feed with title and body summarized to 150 chars, but without HTML, like in this feed: b.dk/seneste/rss.

2
  • Note that you don't necessarily have to disable rss.xml. You really want to change the default feed on the page. That can be done with theming; change <link rel="alternate" type="application/rss+xml" title="" href="rss.xml" /> to whatever you want it to be
    – rfay
    Nov 27, 2011 at 16:31
  • For question 1: see the answers in drupal.stackexchange.com/questions/3782/…
    – batigolix
    Jul 1, 2015 at 21:51

3 Answers 3

3

For your first question, I found the RSS Permissions module, which allow you to disable the RSS feeds based on roles. I haven't tested this out, but it seems to be actively developed. (NOTE: This is for Drupal 7.)

1
  • Yes it defiantly looks like RSS Permissions module can fix my issue for question 1.
    – mtrolle
    Nov 17, 2011 at 10:58
1

For question 1, I have used the answer by Rick Umali.

For question 2: I made a field formatter for the text fields called "Trimmed and stripped" that first strips all HTML and then trims the length of the value. Next I configured the RSS display type for my content types to use this "Trimmed and stripped" field formatter on body. Finally I created the wanted views through Views 3.x module.

But this still leaves HTML around each field. And I wanted to have a clean RSS feed, so I also created a template file named views-view-row-rss.tpl.php, which runs a htmlspecialchars_decode() on $description, and then strip_tags() and finally check_plain()...

And I now got the wanted result - but I think there most be a better solution out there... Or else I should maybe write a module for this one day :)

0
0

Question 1: You should use Views module to create a feed on that path, this will override the items included in the home page feed.

Question 2: You can change the default RSS settings for the site to include full node content or the title or title + summary. Then on a per content type you can set a custom display for feeds, if you need to tweak what is included in the feeds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.