Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » problem with menu in tutorial 1

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

Page: 1
Go to End
Author Topic: 1075 Views
  • servalman
    Avatar
    Community Member
    211 Posts

    problem with menu in tutorial 1 Link to this post

    Hi

    I'm trying to learn to use thi cms so I started with tuto 1 ;)

    I installed evrything fine and idi the first step ok.

    Now I'm stuck with the menu 1 step, Tough I followed expalnation it doesnt appear (I did flush and get the database & template list ok) this is how my Page.ss looks like :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" >
       <head>
          <% base_tag %>
          $MetaTags
          <link rel="stylesheet" type="text/css" href="tutorial/css/layout.css" />
          <link rel="stylesheet" type="text/css" href="tutorial/css/typography.css" />
          <link rel="stylesheet" type="text/css" href="tutorial/css/form.css" />
       </head>
       <body>
          <div id="Main">
          <ul id="Menu1">
    <% control Menu(1) %>
    <li><a href="#">$MenuTitle</a></li>
    <% end_control %>
    </ul>
             <div id="Header">
                <h1>$Title</h1>
             </div>
             <div id="ContentContainer">
                <div id="Content" class="typography">
                   $Content
                   $Form
                </div>
             </div>
             <div id="Footer">
                <span>Visit <a href="http://www.silverstripe.com" title="Visit www.silverstripe.com">www.silverstripe.com</a>; to download the CMS</span>
             </div>
          </div>
          $SilverStripeNavigator
       </body>
    </html>

    Thanks for help.

    One suggestion maybe there should be a tutorial section in the forum

    S

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: problem with menu in tutorial 1 Link to this post

    Hi Servalman, Welcome to silverstripe

    Try removing the <?xml version="1.0" encoding="UTF-8"?> at the top of the page, I know it has caused me problems before. Also you should remove the <link> tags and place them in your Page_Controller class by adding them the init() function like this

    class Page_Controller extends ContentController {
       function init() {
          parent::init();
          
          Requirements::themedCSS("layout");
          Requirements::themedCSS("typography");
          Requirements::themedCSS("form");
       }
    }

    try them first and if it still doesn't work then we can look a bit deeper

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: problem with menu in tutorial 1 Link to this post

    Hi

    Removing the XML déclaration on top of document worked ok.
    I did not try to put the <link> tags in the controler page because I did not complete the second tutorial
    wich deals with more advanced notions, but I will try to smoe point for sure.

    One more question if I remove the XML declaration on top of page, I'm right to think that it is not an xml doc anymore wich can be a problem for me ?

    But thanks again I will move on with the tuto

    T

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: problem with menu in tutorial 1 Link to this post

    hmm, having read some stuff I still cant seem to find a definite answer, but my instinct tells me the browser would have trouble reading an XML document without it.

    I always remove this line as it sends IE6 into quirks mode which causes CSS problems and I have never used true XML in a site so I'm not really the best person to ask.

    Anyone else know more about this?

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: problem with menu in tutorial 1 Link to this post

    Hi

    Strange thing as I tried to use the XML déclaration
    it is now working maybe the flush did not work fine last time.

    I'll keep posted if it happens again

    T

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