Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Tutorial 1 :: Doesn't Work

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2
Go to End
Author Topic: 1946 Views
  • JasonS
    Avatar
    Community Member
    14 Posts

    Tutorial 1 :: Doesn't Work Link to this post

    Right, I have tried this twice now. I am using 2.3 RC2.

    http://doc.silverstripe.org/doku.php?id=tutorial:1-building-a-basic-site

    Creating a New Page Type.

    I have created a new folder called 'code' in the tutorial template folder, added the HomePage and run the db flush. Nothing happens. Has 2.3 changed the way this works. Could someone tell me what I am doing wrong please.

    Thanks

    Jason

  • UncleCheese
    Avatar
    4085 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    The code folder should be a peer to the templates folder, not its child. Can you post the code you're using?

  • JasonS
    Avatar
    Community Member
    14 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    OK, still confused. I am using the code from the tutorial.

    /root/
    /root/themes/
    /root/themes/tutorial/

    Where should the code folder be?

  • JasonS
    Avatar
    Community Member
    14 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    I should add that I did the tutorial install on xampp. I didn't install the the tutorial package. I already have 3 servers on my laptop. XAMPP/Rails/Django. Really do not need a 4th.

  • JasonS
    Avatar
    Community Member
    14 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    Can anyone help with this?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    The code folder belongs in tutorial.. should already be there, though, right?

    /tutorial/code/MyPage.php
    /tutorial/templates/Page.ss
    /tutorial/templates/Layout/MyPage.ss
    /tutorial/css/css.css
    /tutorial/javascript/js.js
    /tutorial/images/img.jpg

  • solar
    Avatar
    10 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    go to your "C:\xampp\htdocs\silverstripe\tutorial\code" folder and duplicate the page.php, if you copy pasted it (ctrl+c, ctrl+v) it will be renamed "Copy of Page.php" rename is to homepage.php then open the file in your editor...I use jEdit -=)

    "class Page extends SiteTree" becomes -> "class HomePage extends SiteTree"
    "class Page_Controller extends ContentController" becomes -> "class HomePage_Controller extends ContentController"

    ok now go to your templates folder and make your HomePage.ss(just dup the Page.ss to HomePage.ss for how, then edit it after the flushes)

    Flush your DB. "(mysite)/db/build?flush=1"
    Flush your CMS "?flush=1"

    when you login to the CMS under page type your going to see HomePage.

    So if you want to know what you did? I got no idea
    You dont have to name is HomePage you can name it any thing just as long as the php class names match.
    Also the first time I tried this, during the DB flush I got some errors. I just did it over again and it worked.
    Please tell me if this works so I can set up a tutorial -=)

  • Sammy
    Avatar
    Community Member
    4 Posts

    Re: Tutorial 1 :: Doesn't Work Link to this post

    Doesn't work for me. The "change to HomePage" doesn't appear in the CMS. I have been trying to fix this for a almost a week with no success. Using Mac OS X 10.5, MAMP localhost:8888 and SilverStripe v 2.2.3.

    Please help me!

    /S

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