Jump to:

22975 Posts in 11620 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Tutorial2: stuck in "Adding date and author fields"

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: 898 Views
  • speedooo
    Avatar
    Community Member
    11 Posts

    Tutorial2: stuck in "Adding date and author fields" Link to this post

    I am following the tutorial 2 today and stuck in this section "Adding date and author fields".
    I created these two new fields and rebuild db, I can see them in database.

    Then I created new "NEWS" section at the same level as "HOME", and change page type to "ArticalHolder".
    After that created new "news Articalpage" under "NEWS", and change the page type to "ArticalPage".

    But I did NOT see the new fields Date and Author in this news artical page.

    Anything I did wrong, please help?

    thanks

    kevin

  • speedooo
    Avatar
    Community Member
    11 Posts

    Re: Tutorial2: stuck in "Adding date and author fields" Link to this post

    I followed the next step... "Creating the templates"
    Created "ArticlePage.ss" and "ArticleHolder.ss" under Layout dir.

    I CMS I created news articlepage, I can see them in website, just without Date and author fields.

    I went to the database, found new created records in "StieTree" table with my news content, but nothing in "ArticlePage" table???

    anything wrong in my process?

    thanks

    kevin

  • speedooo
    Avatar
    Community Member
    11 Posts

    Re: Tutorial2: stuck in "Adding date and author fields" Link to this post

    fixed.
    it's should copy/past " function getCMSFields() {}"
    inside class ArticlePage extends Page {}.

  • risingsunset
    Avatar
    Community Member
    9 Posts

    Re: Tutorial2: stuck in "Adding date and author fields" Link to this post

    I have the same problem. I pasted the "function getCMSFields() {}" but it still doesn't work...
    How knows the CMS to use the new templates? It still uses the "Page.ss"...

  • Aubz
    Avatar
    Community Member
    3 Posts

    Re: Tutorial2: stuck in "Adding date and author fields" Link to this post

    I have the same problem. If I paste the code from ArticlePage.ss that differs from Page.ss ie.
    <div class="news-details">
    <p>Posted on $Date.Nice by $Author</p>
    </div>

    into into the template Page.ss the required Date and author data appear in the pages as required. So the data is in the database. The ArticlePage.ss template is however being completely ignored. This is true for the ArticleHolder.ss template as well. The templates are in themes/simple/templates/layout as the tute requires, the code for the ArticleHolder.php and ArticlePage.php ,in mysite/code, as well as the templates is copied and pasted directly from the tute so how the hell can it be ignored? I did note that the class ArticlePage extends Page code in the tute is very poorly written out as there seems to be conflicting versions of the code given. Is this the source of the errors?

  • Aubz
    Avatar
    Community Member
    3 Posts

    Re: Tutorial2: stuck in "Adding date and author fields" Link to this post

    Okay, had a Doh moment, remember after making changes to templates, flush cached crap away. ?flush=1 on the end of any SilverStripe URL will clear out all cached content.

    898 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.