Jump to:

23360 Posts in 18097 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Tutorial 2 - RSS Feeds

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 943 Views
  • Ronin
    Avatar
    Community Member
    50 Posts

    Tutorial 2 - RSS Feeds Link to this post

    Have completed the section concerning adding a RSS feed to the News page. I have faithfully followed the tutorial withou making any modifications. The RSS icon lights up on the news page but when I select the option I get the following error message.

    Invalid xml declaration.
    Line: 2 Character: 3

    <?xml version="1.0"?>

    Can anyone help?

  • James Bolitho
    Avatar
    Community Member
    33 Posts

    Re: Tutorial 2 - RSS Feeds Link to this post

    I have run into the same problem. After some searching of the forum I found a crude fix posted by another member which solves the problem by adding the following line at 189 to sapphire/api/RSSfeed.php:

    $body=str_replace("<?xml version=\"1.0\"?>","",$body);
    echo $body;

    Original post by bruceb can be viewed here http://www.silverstripe.org/general-questions/show/260501#post260501

    The root of the problem appears to be being caused by a space being inserted into the top of the page html code before the Doc type declaration. I have swapped between the tutorial and Black Candy Theme but it seems to be the same in both. I have looked in the template files and in the class files for spaces but it all looks fine to me.

    Has anyone got any ideas to what could be causing this? Any ideas are welcomed...

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