Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

Archive /

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

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

Problems adding Page types and others


Go to End


6 Posts   2108 Views

Avatar
vivianurvi

Community Member, 5 Posts

21 November 2008 at 11:11am

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???

Avatar
Willr

Forum Moderator, 5523 Posts

21 November 2008 at 1:47pm

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 {}
?>

Avatar
vivianurvi

Community Member, 5 Posts

29 November 2008 at 9:11am

Edited: 29/11/2008 9:12am

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?????

Avatar
Willr

Forum Moderator, 5523 Posts

1 December 2008 at 12:42pm

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

Avatar
vivianurvi

Community Member, 5 Posts

2 December 2008 at 4:09am

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!!

Avatar
vivianurvi

Community Member, 5 Posts

2 December 2008 at 4:16am

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