Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » remove HTML tags from RSS

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

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

Page: 1
Go to End
Author Topic: 1374 Views
  • Anatol
    Avatar
    126 Posts

    remove HTML tags from RSS Link to this post

    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

    1374 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.