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.

General Questions /

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

Admin Menu is moved down


Reply


3 Posts   419 Views

Avatar
Blackthorn87

Community Member, 27 Posts

6 January 2012 at 6:01am

Edited: 06/01/2012 6:07am

Hey Guys,

I'm having some trouble with my cms backend. When I view the pages section in the admin it seems to push down the menu by about 30px.

I first thought it was a css problem, and couldn't find anything. Then I thought I'd check the php code I'd just written from a tutorial I'm working with. When I removed the file containing that code from the folder and rebuilt the db, the gap disappeared. Then I put the file back and the gap reappeared. So I debugged the code (all of which I got from the tutorial - SilverStripe The Complete Guide to CMS Development - Section 5) and found the line:

"class JobCategory extends Page {"

is causing the problem.

From what I can tell the gap is being created with some space in the top of the body, you can see from the attached image. And this seems to be to do with the page rendering some of the head tags in the body. But then when you check the source code, everything looks ok; all the head tags are in the head. Also when I use firebug to delete the gap the menu jumps up.

I have also attached the php file if that helps anyone.

Thanks in advance.

Arun.

Attached Files
Avatar
simon_w

Forum Moderator, 474 Posts

6 January 2012 at 7:26am

You have a space before your opening PHP tag, which is being outputted to the browser.

Avatar
Blackthorn87

Community Member, 27 Posts

6 January 2012 at 10:44pm

Edited: 07/01/2012 1:35am

I just checked the php and can't see any spaces before the opening tag. I even rewrote the line to make sure there wasn't one.

Any more ideas.

EDIT:

Ok, so as I've continued to work on this tutorial it seems like the problem has escalated. The same bug is now affecting the front of my site.

EDIT 2:

So as I was writing my first edit to this Post I managed to solve the problem. I validated the html generated and it passed with a UTF-8 warning. This prompted one of the guys with me to notice that the file should have been in ANSI and not UTF-8, so I changed the file type of all the files I created and ALL the gaps disappeared!