Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Tutorial not working for 2.2.0

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

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

Page: 1 2
Go to End
Author Topic: 3813 Views
  • defrian
    Avatar
    Community Member
    5 Posts

    Tutorial not working for 2.2.0 Link to this post

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

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

    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>

  • defrian
    Avatar
    Community Member
    5 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

    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" 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?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

    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

  • defrian
    Avatar
    Community Member
    5 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

    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

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

    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

  • defrian
    Avatar
    Community Member
    5 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

    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?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Tutorial not working for 2.2.0 Link to this post

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

    Cheers,
    Sean

    3813 Views
Page: 1 2
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.