Jump to:

1844 Posts in 1600 Topics by 559 members

Blog Module

SilverStripe Forums » Blog Module » RSS Feed : nothing displayed when BlogEntry has more than 1 HTML tag

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 963 Views
  • Kisskool
    Avatar
    Community Member
    11 Posts

    RSS Feed : nothing displayed when BlogEntry has more than 1 HTML tag Link to this post

    Hi !

    I've searched during some days, but I didn't find the solution to my problem : when a BlogEntry (= a blog post) has more than 1 HTML tag, or if it has 1 HTML tag but it is different from <p>, the content of this BlogEntry isn't displayed into the RSS Feed (mysite/blog/rss).

    I've never seen this problem among the subjects that I looked , and I have yet to figure out where this problem.

    Here is my code :

    BlogHolder.php, class BlogHolder_Controller extends BlogTree_Controller

       function init() {
          RSSFeed::linkToFeed($this->Link() . "rss", _t('BlogHolder.RSSFEED',"RSS feed of these blogs"));
          parent::init();
          Requirements::themedCSS("bbcodehelp");
       }

       function rss() {
          // Check if any blog article page exists
          $children = DataObject::get_one("BlogHolder");

          // If there is blog article pages get 10 latest, with status published sorted in reverse order
          if($children) {
             // Get children pages
             $children = DataObject::get("BlogEntry", "Status = 'Published'", "Sort DESC", "", 10);
             // Create RSS feeds
             $rss = new RSSFeed($children, $this->Link(), "RSS", "", "Title", "Content");
             // Add link in header using XML content type
             $this->response->addHeader('Content-type','application/xml');
             // Output RSS feeds to browser
             $rss->outputToBrowser();
          }
       }

    If you know how to fix this problem, or any idea, I'm interested !

  • Kisskool
    Avatar
    Community Member
    11 Posts
  • Kisskool
    Avatar
    Community Member
    11 Posts

    Re: RSS Feed : nothing displayed when BlogEntry has more than 1 HTML tag Link to this post

    Up !

    And another thing : if a blog post hasn't HTML tags (deleted from the database, via the sitetree_live table), this blog post is displayed into my RSS Feed.

    I think it's a HTML parse problem...if not, why just <p> tag or "no tags" do not cause problems ? I'm working on it since the 12, but I have not yet found a solution.

    If I don't find the solution, I'll use a "hack" : wrap all my blog posts with a <p></p>. But it's not HTML valid, and poses problems.

    Or I have another idea : select all the RSS content (feedEntryContent), delete them, and replace with a good HTML. But I don't know how get the RSS content, and after inject into a good HTML.

  • Kisskool
    Avatar
    Community Member
    11 Posts

    Re: RSS Feed : nothing displayed when BlogEntry has more than 1 HTML tag Link to this post

    Good, I advance in my debugging !

    I did a complete clean reinstallation of SilverStripe and Blog module, with my theme, and I still have the same problem.
    Or the blog module is bugged, or my theme is the problem.

    I continue to search.

    My config is SS 2.4.7, and Blog 0.4.1

  • Kisskool
    Avatar
    Community Member
    11 Posts

    Re: RSS Feed : nothing displayed when BlogEntry has more than 1 HTML tag Link to this post

    Ok, without my theme, I still have the same problem. So the problem is the module Blog.

    I tried with other versions. With v0.6.0-rc1 I have a blank page. With v0.3.1 I have a stripped out of tag text.

    ==> the problem is the Blog module.

    I will try to properly install the Blog module v0.6.0-rc1, and see if I still have this problem.

    963 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.