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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

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

Tutorial not working for 2.2.0


Go to End


11 Posts   4389 Views

Avatar
defrian

Community Member, 5 Posts

1 December 2007 at 12:36pm

Hi there,

i just found silverstripe CMS by surfin through the Google Highly Open Participation Contest website. After installing it on windows xp sp2 / xampp i followed the instructions of the online tutorial. i came up for the "creating a new template" section and created a HomePage.php, the HomePage.ss, flushed the database and the cms cache. without success. i can´t select the HomePage page type from the "new page" dropdown. So now i am quite helpless wondering if this is a bug or if i have done something wrong...

Avatar
Fuzz10

Community Member, 791 Posts

2 December 2007 at 4:12am

Edited: 02/12/2007 8:59am

You have probably done something wrong. Watch for typo's (case-sensitivity)..

Make sure to refresh the backend itself too.... (www.site.com/admin/cms?flush=1)

<edit>
Oh, and if you cannot figure it out..Post your code here...
</edit>

Avatar
defrian

Community Member, 5 Posts

2 December 2007 at 9:31am

Edited: 02/12/2007 9:32am

Hi! Thanks for your Support. I double checked everything but did not found a mistake. For adding a new page i did the following:

1) Created a new PHP File named HomePage.php and saved it at <silverStripeHome>\tutorial\code

Source:

<?php
/**
 * Defines the HomePage page type
 */

class HomePage extends Page {
   static $db = array(
   );
   static $has_one = array(
   );
}

class HomePage_Controller extends Page_Controller { }
?>

2) Created a new PHP File named HomePage.ss and saved it at <silverStripeHome>\tutorial\templates

Source:

<?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">
				<ul id="Menu2">
				  <% control Menu(2) %>
				    <li class="$LinkingMode"><a href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a></li>
				  <% end_control %>
				</ul>
				<div id="Content" class="typography">
					<div class="breadcrumbs">
					  $Breadcrumbs
					</div>
					$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>

3) Called http://localhost/silverstripe220/db/build?flush=1
Controlled the result list of the server response. It does not contain a table named HomePage
4) Called http://localhost/silverstripe220/?flush=1
5) Logged into backend and called http://localhost/silverstripe220/admin/?flush=1

I am at a loss. Any ideas?

Avatar
Sean

Forum Moderator, 922 Posts

2 December 2007 at 9:50am

Edited: 02/12/2007 10:01am

Can you try moving them from tutorial, to mysite and see if that works?

I think db/build doesn't recognise the code inside the tutorial folder. Although clearly it should be.

Seems to work for me. Very strange. Is this a complete clean install of 2.2?

Cheers,
Sean

Avatar
defrian

Community Member, 5 Posts

2 December 2007 at 10:03am

I worked! But i don´t understand why? the rest of the /mysite folders are empty.

is there a config file where i can check if silverstripe uses the mysite or the tutorials installation?

could this be connected with this error message which i get when i try to "sort sub pages?"

Error in Ajax evaluator on line 974: invalid flag after regular expression
Notice: Undefined index: ID in D:\xampp\xampp\htdocs\silverstripe220\cms\code\LeftAndMain.php on line 671
Systemfehler

Avatar
Sean

Forum Moderator, 922 Posts

2 December 2007 at 10:08am

Edited: 02/12/2007 10:12am

Is there a _config.php file inside tutorial?

One other thing you could try is removing the template, but leave HomePage.php in the templates/code and see if it works.

Cheers,
Sean

Avatar
defrian

Community Member, 5 Posts

2 December 2007 at 11:03am

Oh alright, that´s it. the config file was missing in /tutorials i copied the one from /mysite an now the new page works. the ajax error remains.

should i create a new thread for the sub pages sorting ajax error, or is it okay to discuss it here?

Avatar
Sean

Forum Moderator, 922 Posts

2 December 2007 at 11:08am

Probably make a new thread. I'm not too sure about your ajax error.

Cheers,
Sean

Go to Top