From 18a1cc1db3646e73fb110ff92e1c81249b020f79 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sat, 31 Mar 2012 09:03:54 +1300 Subject: [PATCH] MINOR: update docs to fix issues raised via comments. MINOR: remove section on comments. --- docs/en/tutorials/2-extending-a-basic-site.md | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/docs/en/tutorials/2-extending-a-basic-site.md b/docs/en/tutorials/2-extending-a-basic-site.md index 198d8f523..e5662a23f 100644 --- a/docs/en/tutorials/2-extending-a-basic-site.md +++ b/docs/en/tutorials/2-extending-a-basic-site.md @@ -87,7 +87,6 @@ We'll start with the *ArticlePage* page type. First we create the model, a class } - ?> Here we've created our data object/controller pair, but we haven't actually extended them at all. Don't worry about the @@ -116,8 +115,6 @@ Let's create the *ArticleHolder* page type. class ArticleHolder_Controller extends Page_Controller { } - - ?> Here we have done something interesting: the *$allowed_children* field. This is one of a number of static fields we can @@ -249,7 +246,7 @@ Let's walk through these changes. *$dateField* is added only to the DateField in order to change the configuration. :::php - $dateField->setConfig('showCalendar', true); + $dateField->setConfig('showcalendar', true); Set *showCalendar* to true to have a calendar appear underneath the Date field when you click on the field. @@ -424,44 +421,6 @@ This will change the icons for the pages in the CMS. ![](_images/icons2.jpg) -### Allowing comments on news articles - -A handy feature built into SilverStripe is the ability for guests to your site to leave comments on pages. We can turn -this on for an article simply by ticking the box in the behaviour tab of a page in the CMS. Enable this for all your -*ArticlePage*s. - -![](_images/comments.jpg) - -We then need to include *$PageComments* in our template, which will insert the comment form as well as all comments left -on the page. - -**themes/tutorial/templates/Layout/ArticlePage.ss** - - :::html - ... -
- Posted on $Date.Nice by $Author -
- $PageComments - ... - - -You should also prepare the *Page* template in the same manner, so comments can be enabled at a later point on any page. - -![](_images/news-comments.jpg) - -It would be nice to have comments on for all articles by default. We can do this with the *$defaults* array. Add this to -the *ArticlePage* class: - - :::php - static $defaults = array( - 'ProvideComments' => true - ); - - -You can set defaults for any of the fields in your data object. *ProvideComments* is defined in *SiteTree*, so it is -part of our *ArticlePage* data object. - ## Showing the latest news on the homepage It would be nice to greet page visitors with a summary of the latest news when they visit the homepage. This requires a