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.

We've moved the forum!

Please use for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

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

Silverstripe 3 possible bug inserting blank lines at the top of all pages

Go to End

4 Posts   3296 Views


Community Member, 5 Posts

3 April 2013 at 1:26pm

It appears that Silverstripe 3 may be inserting blank lines into the <body> of my html. Is anyone else getting an empty space at the top of their pages (website, and admin pages including CMS and dev/build)?

It appears that it could have something to do with this meta tag, but only because nothing else in my templates appears to affect this blank space at all:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I have tried changing to the "Simple" theme provided with Silverstripe and this blank space still appeared, so I am wondering if it could be a bug with Silverstripe 3, or perhaps something in my code could be causing it.

It seems to manifest itself as empty space within double quotes directly inside the <body> tags, but this code only appears when inspecting with dev tools, it doesnt come up when viewing source code.

Can anyone shed any light on this issue at all?

I am using SS version 3.0.3.

Thanks :)


Forum Moderator, 5523 Posts

3 April 2013 at 9:05pm

This can sometimes happen if you have trialing whitespace after a ?> tag in your PHP files. Check your custom PHP code so that they don't include the ?> tag.


Community Member, 5 Posts

4 April 2013 at 3:54pm

That would make sense as I had narrowed it down to what is most likely an issue in my PHP files. The problem isn't present on another site I am working on

I searched out and found a couple of stray closing ?> tags but it doesn't appear to have resolved the issue (flushed cache after updates).

Any other thoughts along the same lines? It would seem to me to be most likely something in my PHP files, but I wonder if it's possible content that has been pasted in through the CMS could affect a site in this way?

I have the SortableGridField module installed but I have it a go without it and there was no change.

So frustrating :( I know in the end it will be some tiny yet obvious thing I have done wrong that has caused this issue which makes it even worse!


Community Member, 99 Posts

4 October 2014 at 3:47am

yes i have blank lines at the very top .. before document declaration.

but what module , or my custom php files are causing it is a real pain.

i couldn't get thread i found this to work either.