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.


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

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

Tutorial not working for 2.2.0

Go to End

11 Posts   3878 Views


1 December 2007 at 12:36pm Community Member, 5 Posts

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


2 December 2007 at 4:12am (Last edited: 2 December 2007 8:59am), Community Member, 787 Posts

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

Make sure to refresh the backend itself too.... (

Oh, and if you cannot figure it out..Post your code here...


2 December 2007 at 9:31am (Last edited: 2 December 2007 9:32am), Community Member, 5 Posts

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


* 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 and saved it at <silverStripeHome>\tutorial\templates


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="" xml:lang="en" >
      <% base_tag %>
      <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" />
      <div id="Main">
      <ul id="Menu1">
       <% control Menu(1) %>
       <li><a href="#">$MenuTitle</a></li>
       <% end_control %>
         <div id="Header">
         <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 %>
            <div id="Content" class="typography">
               <div class="breadcrumbs">
         <div id="Footer">
            <span>Visit <a href="" title="Visit"></a> to download the CMS</span>

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?


2 December 2007 at 9:50am (Last edited: 2 December 2007 10:01am), Forum Moderator, 921 Posts

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?



2 December 2007 at 10:03am Community Member, 5 Posts

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


2 December 2007 at 10:08am (Last edited: 2 December 2007 10:12am), Forum Moderator, 921 Posts

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.



2 December 2007 at 11:03am Community Member, 5 Posts

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?


2 December 2007 at 11:08am Forum Moderator, 921 Posts

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


Go to Top