Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Tutorial one - Page type Home Page not showing up in the dropdown box

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
Go to End
Author Topic: 599 Views
  • WillJonMax
    Avatar
    Community Member
    4 Posts

    Tutorial one - Page type Home Page not showing up in the dropdown box Link to this post

    Despite trying out various solutions from the forum posts, I didn't have any luck.

    My problem is, from tutorial one, I couldn't seem to create the page type, from HomePage.php, to appear in the Page Type dropdown, after rebuilding using this url http://localhost:8888/SilverStripe/mysite/dev/build?flush=all

    I am using SilverStripe 3.0.1 and I installed it on my MacBook Pro's local machine. The php file, HomePage.php, is stored in this directory -> MAMP/htdocs/SilverStripe/mysite/code

    At present, there are two files in this directory, HomePage.php and Page.php

    The code in HomePage.php is this

    <?php
    class HomePage extends Page {}
    class HomePage_Controller extends Page_Controller {}

    My questions:-

    1. Should there be a PHP closing tag ?> in this file? e.g. <?php ...... ?>
    2. Every time, I rebuilt it I get a login page which says I must be an adminstrator to continue the rebuild. That's even when I am already logged in!
    3. What should the correct url be in my case for rebuilding ? I guess it's http://localhost:8888/Silverstripe/mysite/dev/build?flush=1
    Is 'mysite' correct?

    What have I done wrong? I apprecicate any help from you

    Thanks

    Will

  • martimiz
    Avatar
    Forum Moderator
    1038 Posts

    Re: Tutorial one - Page type Home Page not showing up in the dropdown box Link to this post

    Hi WillJonMax, welcome to the forums,

    First: your homepage code looks fine to me. But if dev/build/?flush=1 (all) doesn't work, then HomePage will never be added to the database, and it won't appear in the dropdown, so that's understandable.

    @1: no closing php tag needed
    @2: that shoudn't happen - unless you're logged in as someone that's not an administrator. Are you redirected to the login screen, or do you get some other message/error?
    @3: in the URL you should add dev/build/?flush=1 to the root URL of your website. So if your site URL is localhost:8888/ then it would be localhost:8888/dev/build?flush=1. If I add an extra mysite/ to my URL, I get a 'page not found'...

    Some other things you could check:

    Do you have the same problem on a fresh SilverStripe install?
    Do you have the same problem using another browser?
    Do you have a default MAMP install or did you change any (php) settings?
    Do the MAMP error logs show anything weird? Find them in application/MAMP/logs (I guess)

    Martine

  • WillJonMax
    Avatar
    Community Member
    4 Posts

    Re: Tutorial one - Page type Home Page not showing up in the dropdown box Link to this post

    Thank you for your swift response.

    @1 Ok thanks - just to be sure there!

    @2 & @3 Yes, I got re-directed to a login page. It might be that I incorrectly put dev/build/?flush=1 I try do that at the root of my website.

    - The SilverStripe install was smooth - no problems.

    - As SliverStripe recommended using FireFox, I having been using this since then...

    - I am sure I did the default MAMP install - no fiddling with php files...

    - No errors in the log - everything resuming as normal..

  • WillJonMax
    Avatar
    Community Member
    4 Posts

    Re: Tutorial one - Page type Home Page not showing up in the dropdown box Link to this post

    I tried re-build it using this url localhost:8888/dev/build?flush=1 but came up with an error - "The requested URL /dev/build was not found on this server."

    Any ideas why?

  • WillJonMax
    Avatar
    Community Member
    4 Posts

    Re: Tutorial one - Page type Home Page not showing up in the dropdown box Link to this post

    I finally got it working now!

    It's actually http://localhost:8888/SilverStripe/dev/build?flush=1 that did the build. SilverStripe is where I renamed from 'SilverStripe_3_0_1" (similar like that....)

    The HomePage.php is in this directory

    MAMP/htdocs/SilverStripe/mysite/code

    Thanks!

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