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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

problem with menu in tutorial 1


Go to End


5 Posts   2023 Views

Avatar
servalman

Community Member, 211 Posts

5 January 2009 at 7:42am

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

Community Member, 598 Posts

5 January 2009 at 8:40am

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

Community Member, 211 Posts

5 January 2009 at 9:30pm

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

Community Member, 598 Posts

6 January 2009 at 2:07am

Edited: 06/01/2009 2:13am

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

Community Member, 211 Posts

6 January 2009 at 3:30am

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