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.

Themes /

Discuss SilverStripe Themes.

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

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


Reply


3 Posts   867 Views

Avatar
Beau

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 :)

Avatar
Willr

Forum Moderator, 5513 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.

Avatar
Beau

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!