Jump to:

23001 Posts in 11702 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Admin Menu is moved down

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: 297 Views
  • Blackthorn87
    Avatar
    Community Member
    27 Posts

    Admin Menu is moved down Link to this post

    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
  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: Admin Menu is moved down Link to this post

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

  • Blackthorn87
    Avatar
    Community Member
    27 Posts

    Re: Admin Menu is moved down Link to this post

    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!

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