Jump to:

3435 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » Extend UserForm - Page.ss not being used

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

Page: 1
Go to End
Author Topic: 1020 Views
  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Extend UserForm - Page.ss not being used Link to this post

    SS - 2.4.4
    UF - 0.3.0

    I want to make a custom page from UserDefinedForm called ContactPage, so I can mess around with the layout without affecting future forms. I have done this as follows by creating ContactPage.php in mysite (not the userforms directory):

    class ContactPage extends UserDefinedForm {

       public static $db = array(
       );

       public static $has_one = array(
       );

    }
    class ContactPage_Controller extends UserDefinedForm_Controller {

       public static $allowed_actions = array (
       );

       public function init() {
          parent::init();

       }
    }

    dev/build and all seems well in the CMS. So I also make a ContactPage.ss template in /themes/mysite/Layout with some basic HTML.

    When I view the new page, it seems that it is not even using the main Page.ss file as a base, let alone my custom sub template. All I see is the content and this line on a blank white page.

    Generated with the default ContentController.ss template

    Any ideas what I've done wrong here?

    Aaron

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