21301 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 169 Views |
-
Article Holder, Article Page Problem

3 January 2013 at 2:05am
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
-
Re: Article Holder, Article Page Problem

3 January 2013 at 11:17pm
Another thing is if I try to duplicate any page I got error saving content? Does anybody have a tip, please?
-
Re: Article Holder, Article Page Problem

4 January 2013 at 3:32am
OKAY I FOUND THE SOLUTION! I UPDATED SS TO VERSION 2.4.9 IT WORKS NOW PERFECT!
SHIT HAPPENS ;)
| 169 Views | ||
|
Page:
1
|
Go to Top |

