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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Article Holder, Article Page Problem


Reply


3 Posts   434 Views

Avatar
Silver2010

Community Member, 5 Posts

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

Attached Files
Avatar
Silver2010

Community Member, 5 Posts

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?

Avatar
Silver2010

Community Member, 5 Posts

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 ;)