Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » problem in the creation of new page type.

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

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

Page: 1
Go to End
Author Topic: 1387 Views
  • ojalà
    Avatar
    Community Member
    87 Posts

    problem in the creation of new page type. Link to this post

    Hi!
    I follow the instruction in the tuorial (number 1) to create a new page type.
    Thwy say to create a new file in /tutorial/code NewPageType.ss whith the following code:

    <?php
    /**
    * Defines the NewPageType page type
    */

    class NewPageType extends Page {
    static $db = array(
    );
    static $has_one = array(
    );

    }

    class NewPageType_Controller extends Page_Controller {
       
    }
    ?>

    Then is necessary to build the db so I digit:

    http://mysite/db/build

    Nothig change: I'm unable to select the new page type, it isn't create. Why?

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: problem in the creation of new page type. Link to this post

    Run a http://mysite/db/build?flush=1

    Then reload the admin backend with a ?flush=1 as well....

  • jest
    Avatar
    Community Member
    6 Posts

    Re: problem in the creation of new page type. Link to this post

    Hi there

    Is that working for you? Am working my way through tutorial one, and am trying to create a new page type. Have uploaded the HomePage.php, and run the http://www.mydomain.com/silverstripe/db/build?flush=1.

    Everything seems to going ok, the SiteTree, SiteTree_Live and SiteTree_versions seem to have updated well, but then it comes to a screaming halt with an error message:

    "Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mydomain.com/httpdocs/silverstripe/sapphire/core/model/DatabaseAdmin.php:137) in /var/www/vhosts/mydomain.com/httpdocs/silverstripe/sapphire/core/Debug.php on line 151".

    Any ideas?

  • jest
    Avatar
    Community Member
    6 Posts

    Re: problem in the creation of new page type. Link to this post

    Arrgggh, have solved problem.

    Note: when saving a new page type, pay attention to the lower and uppercase spelling of the filename: I saved the file as Homepage.php, not HomePage.php.

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