Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

remove HTML tags from RSS


Reply

1393 Views

Avatar
Anatol

3 September 2008 at 12:43pm 126 Posts

Hi,

I am using the blog module with TinyMCE rich text editor. Is there any way to remove the HTML tags that I use in blog posts from the RSS output? I use embedded video in some blog posts but both the embed and object tag are no valid elements for RSS. I have problems to load the feed into another page.

I tried strip_tags() in various places - even in the sapphire RSSFeed class - but nothing seems to work. Ideally I would not like to touch sapphire for this.

This is a sample of my modified RSS generating code in BlogHolder.php:

function rss() {
      global $project;
      $rss = new RSSFeed($this->LatestEntries(), $this->Link(), "MyDomain - 10 most recent blog entries", "Show the 10 most recent blog entries.", "Title", "Content");
      $rss->outputToBrowser();
   }
   
   function LatestEntries() {
      // return the latest 10 blog articles
      return DataObject::get("BlogEntry", "", "`SiteTree_Live`.ID DESC", "", 10);
   }

Any help or suggestion is appreciated.

Cheers!
Anatol