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.

Template Questions

problem with menu in tutorial 1


Reply

5 Posts   1096 Views

Avatar
servalman

5 January 2009 at 7:42am Community Member, 211 Posts

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" xml: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

Avatar
Carbon Crayon

5 January 2009 at 8:40am Community Member, 598 Posts

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

Avatar
servalman

5 January 2009 at 9:30pm Community Member, 211 Posts

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

Avatar
Carbon Crayon

6 January 2009 at 2:07am (Last edited: 6 January 2009 2:13am), Community Member, 598 Posts

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?

Avatar
servalman

6 January 2009 at 3:30am Community Member, 211 Posts

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