Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Extending my site

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

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

Page: 1 2 3
Go to End
Author Topic: 10503 Views
  • UncleCheese
    Avatar
    4085 Posts

    Extending my site Link to this post

    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?

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Extending my site Link to this post

    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)

  • UncleCheese
    Avatar
    4085 Posts

    Re: Extending my site Link to this post

    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.

  • trevor
    Avatar
    53 Posts

    Re: Extending my site Link to this post

    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

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Extending my site Link to this post

    LOL..

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

    Your code should work UncleCheese...

  • trevor
    Avatar
    53 Posts

    Re: Extending my site Link to this post

    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.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Extending my site Link to this post

    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 ;-)

  • UncleCheese
    Avatar
    4085 Posts

    Re: Extending my site Link to this post

    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?

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