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

Tutorial2: stuck in "Adding date and author fields"


6 Posts   969 Views


3 April 2009 at 8:41am Community Member, 11 Posts

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?




3 April 2009 at 9:09am Community Member, 11 Posts

I followed the next step... "Creating the templates"
Created "" and "" 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?




3 April 2009 at 1:24pm Community Member, 11 Posts

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


5 May 2009 at 4:31am Community Member, 9 Posts

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


29 October 2012 at 4:54pm (Last edited: 29 October 2012 4:55pm), Community Member, 3 Posts

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

into into the template the required Date and author data appear in the pages as required. So the data is in the database. The template is however being completely ignored. This is true for the 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?


29 October 2012 at 5:08pm (Last edited: 29 October 2012 5:08pm), Community Member, 3 Posts

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.