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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

New page trouble:(


Go to End


7 Posts   1648 Views

Avatar
chuckwood

Community Member, 6 Posts

30 July 2008 at 4:36pm

Hi folks

SilverStripe is my first CMS and I'm pretty new to php too, so forgive me if I'm doing something really obviously wrong!

I've been following the tutorials, but when I try to make a new page in /tutorial/code/ following the instructions (eg. HomePage.php or ArticlePage.php) it just won'tshow up in my CMS even after flushing it.

Anyone know what I could be doing wrong?

Thanks!!

Avatar
Willr

Forum Moderator, 5523 Posts

30 July 2008 at 10:43pm

have you rebuilt the database?

Avatar
chuckwood

Community Member, 6 Posts

31 July 2008 at 9:04am

Thats http://localhost:3000/db/build?flush=1 ?
Yes I've done that. Still not showing up in the behaviour tab.

Avatar
Sean

Forum Moderator, 922 Posts

31 July 2008 at 9:33am

Edited: 31/07/2008 9:34am

Make sure:

The file name is exactly the same name as the class name.

e.g. HomePage.php should have this class structure:


class HomePage extends Page {

}

class HomePage_Controller extends Page_Controller {

}

Also, the file MUST be in the code directory of the project. If it isn't, it may not be picked up by the build script.

Sean

Avatar
chuckwood

Community Member, 6 Posts

31 July 2008 at 9:58am

Ok, the files are in the C:\wamp\www\lighttpd\htdocs\tutorial\code directory, but the CMS itself seems to be in C:\wamp\www\lighttpd\sbin. Is that where the problem is?
The file name and class name are exactly the same.
Thank you for your help!

Avatar
Sean

Forum Moderator, 922 Posts

31 July 2008 at 10:19am

Yes, that would be a problem. They need to be in the same location, i.e. the CMS should be in the same root level directory as where your code is.

e.g.

htdocs/cms
htdocs/sapphire
htdocs/jsparty
htdocs/tutorial
htdocs/tutorial/code
htdocs/.htaccess

Avatar
chuckwood

Community Member, 6 Posts

31 July 2008 at 10:26am

Yeah I thought that was a bit strange now that I've discovered that. Ok will move things around and see if I can get it going.
I keep reassuring myself that I thought HTML and CSS were tricky when I started learning them, so I'll get there with this too!