21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 189 Views |
-
Admin Menu is moved down

6 January 2012 at 6:01am Last edited: 6 January 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.
-
Re: Admin Menu is moved down

6 January 2012 at 7:26am
You have a space before your opening PHP tag, which is being outputted to the browser.
-
Re: Admin Menu is moved down

6 January 2012 at 10:44pm Last edited: 7 January 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!
| 189 Views | ||
|
Page:
1
|
Go to Top |

