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???
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.
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 {}
?>
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?????
Did you install with the tutorial option (rather then the blackcandy) and that file inside tutorial/code/
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!!
thank you for all, I fixed it already!!.