Jump to:

22979 Posts in 11815 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Article Holder, Article Page Problem

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

Page: 1
Go to End
Author Topic: 342 Views
  • Silver2010
    Avatar
    Community Member
    5 Posts

    Article Holder, Article Page Problem Link to this post

    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
  • Silver2010
    Avatar
    Community Member
    5 Posts

    Re: Article Holder, Article Page Problem Link to this post

    Another thing is if I try to duplicate any page I got error saving content? Does anybody have a tip, please?

  • Silver2010
    Avatar
    Community Member
    5 Posts

    Re: Article Holder, Article Page Problem Link to this post

    OKAY I FOUND THE SOLUTION! I UPDATED SS TO VERSION 2.4.9 IT WORKS NOW PERFECT!

    SHIT HAPPENS ;)

    342 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.