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

Extending my site


Go to End


17 Posts   11335 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 September 2007 at 9:15am

I'm trying to extend my site to include an employee page, where users could upload a photo and enter a bio. I've created the class extensions in EmployeePage.php, but it doesn't seem to be updating the database because my new page type doesn't appear in the dropdown menu in the Behaviors tab.

I went to www.mysite.com/admin/db/build?flush=1 and it did a bunch of processing, but I don't see anything new.

What might be going on, here?

Avatar
Fuzz10

Community Member, 791 Posts

27 September 2007 at 1:38am

You might have to flush the backend as well so it reloads all new classes / configs.
(e.g. www.xxx.com/admin/cms?flush=1)

Avatar
UncleCheese

Forum Moderator, 4102 Posts

27 September 2007 at 7:58am

No luck. I checked my DB, too, and it doesn't appear to have done anything. This is what I have defined in /code/EmployeePage.php:

<?php
/**
* Defines the EmployeePage type
*/

class EmployeePage extends Page {

static $db = array (
'Title' => 'Text',
'Bio' => 'Text'
);
static $has_one = array (
);

}

class EmployeePage_controller extends Page_controller {

}

?>

This should work, right? I'm following the tutorial for expanding a basic site.

Avatar
trevor

53 Posts

27 September 2007 at 9:03am

Hi,

not sure if it makes any difference but when I add pageTypes I generally run www.xxx.com/db/build?flush=1 rather from under the admin section ie admin/db/build?flush=1

hey maybe worth a try.

regards

trevor

Avatar
Fuzz10

Community Member, 791 Posts

27 September 2007 at 9:19am

Edited: 27/09/2007 9:20am

LOL..

Good one Trevor.. That has to be it.....

Your code should work UncleCheese...

Avatar
trevor

53 Posts

27 September 2007 at 9:40am

hey i'm new to this only trying to help :)

So enlighten me if its not correct and the reason why instead of taking the mick.

I had this happen but then try again or do different things and then seems to work like logging out and back in and the page types are there maybe a cache thing didn't write everything down that did or didn't work.

Avatar
Fuzz10

Community Member, 791 Posts

28 September 2007 at 12:22am

no no no !

I wasn't laughing at you !! I laughed at the situation that we totally missed the incorrect URL and were focussing on the code itself.

Sorry for the misunderstanding there ;-)

Avatar
UncleCheese

Forum Moderator, 4102 Posts

28 September 2007 at 2:13am

Okay! The new URL should definitely work. I get prompted for a username and password when I navigate to it, though, and NOTHING WORKS!!!

I've tied my CMS login, my database login, and everything else imaginable. What's the deal? Where can I find this information?

Go to Top