Hi there, I updated my SS 2.3.3 to SS 2.4.8. everything seems to work.
But my Newssection does not work perfect anymore? When I create a new ArticlePage or Articleholder in the CMS Backend the article is twice. It shows me two NeuArticlePages? I can edit this pages but when I rename the sitename field NeuArticelPage into Latest News I can't save article anymore. Saving Error.
How can I get only one ArticlePage and what is the problem with sitename field. I used this tutorial:
http://doc.silverstripe.org/framework/en/2.4/tutorials/2-extending-a-basic-site
this is my code:
articlepage.php
<?php
/**
* Defines the ArticlePage page type
*/
class ArticlePage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Text'
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', $dateField = new DateField('Date','Article Date (for example: 20/12/2010)'), 'Content');
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd/MM/YYYY');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author','Author Name'), 'Content');
return $fields;
}
static $icon = "themes/tutorial/images/treeicons/news";
}
class ArticlePage_Controller extends Page_Controller {
}
?>
articleholder.php
<?php
/**
* Defines the ArticleHolder page type
*/
class ArticleHolder extends Page {
static $db = array(
);
static $has_one = array(
);
static $allowed_children = array('ArticlePage');
static $icon = "themes/tutorial/images/treeicons/news";
}
class ArticleHolder_Controller extends Page_Controller {
function rss() {
$rss = new RSSFeed($this->Children(), $this->Link(), "DiaPat News");
$rss->outputToBrowser();
}
}
?>
I attched you a screenshot.
please help!
Clemens