Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Problems adding Page types and others

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: 1520 Views
  • vivianurvi
    Avatar
    Community Member
    5 Posts

    Problems adding Page types and others Link to this post

    I'm developing the tutorial and i've followed all steps but when I try to add a new page type i do all the tutorial says but they don't appear in the page type list. I built the datadase, I flushed and nothing. Could ypu help me please???

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Problems adding Page types and others Link to this post

    Couple things to check - if you installed with 2.2.3 and the tutorial theme make sure your code is in tutorial/code/ otherwise it should be in mysite/code/. Make sure your new page type has the correct code eg its at least like.

    <?php
    class PageType extends Page {}
    class PageType_Controller extends Page_Controller {}
    ?>

  • vivianurvi
    Avatar
    Community Member
    5 Posts

    Re: Problems adding Page types and others Link to this post

    I must be doing something wrong. I did what you said but I still have the same problem. For example the Page Type ArticlePage doesn't appear and it's the code:

    <?php

    /**
    * Defines the ArticlePage page type
    */
    class ArticlePage extends Page {
       static $db = array(
          'Date' => 'Date',
          'Author' => 'Text'
       );
       static $has_one = array(
       );
       static $defaults = array(
          'ProvideComments' => true
       );
       static $icon = "mysite/images/treeicons/news";
       
       function getCMSFields() {
          $fields = parent::getCMSFields();
          
          $fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
          
          return $fields;
       }
    }

    class ArticlePage_Controller extends Page_Controller {

    }

    ?>

    What's wrong with that code?????

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Problems adding Page types and others Link to this post

    Did you install with the tutorial option (rather then the blackcandy) and that file inside tutorial/code/

  • vivianurvi
    Avatar
    Community Member
    5 Posts

    Re: Problems adding Page types and others Link to this post

    I uninstalled and installed again and I found this that could be the reason of my problems:

    File permissions
    Does the webserver know where files are stored? OK (C:\wamp\www\silverstripe-v2.2.3/)
    mysite/ folder exists OK
    sapphire/ folder exists OK
    cms/ folder exists OK
    jsparty/ folder exists OK

    Is the .htaccess file writeable? Unable to detect whether I can write to files. Please ensure C:\wamp\www\silverstripe-v2.2.3/.htaccess is writable.
    Is the mysite/ folder writeable? Unable to detect whether I can write to files. Please ensure C:\wamp\www\silverstripe-v2.2.3/mysite is writable.
    Is the tutorial/ folder writeable? Unable to detect whether I can write to files. Please ensure C:\wamp\www\silverstripe-v2.2.3/tutorial is writable.
    Is the assets/ folder writeable? Unable to detect whether I can write to files. Please ensure C:\wamp\www\silverstripe-v2.2.3/assets is writable.
    Is the temporary folder writeable? OK

    Could it be the problem?? if it's the problem, how can I fix it??

    Thank you!!

  • vivianurvi
    Avatar
    Community Member
    5 Posts

    Re: Problems adding Page types and others Link to this post

    thank you for all, I fixed it already!!.

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