Skip to content
This repository
Browse code

MINOR: update docs to fix issues raised via comments. MINOR: remove s…

…ection on comments.
  • Loading branch information...
commit 18a1cc1db3646e73fb110ff92e1c81249b020f79 1 parent 7c1b40d
Will Rossiter authored March 31, 2012
43  docs/en/tutorials/2-extending-a-basic-site.md
Source Rendered
@@ -87,7 +87,6 @@ We'll start with the *ArticlePage* page type. First we create the model, a class
87 87
 		
88 88
 	}
89 89
 	 
90  
-	?>
91 90
 
92 91
 
93 92
 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.
116 115
 	class ArticleHolder_Controller extends Page_Controller {
117 116
 		
118 117
 	}
119  
-	 
120  
-	?>
121 118
 
122 119
 
123 120
 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.
249 246
 *$dateField* is added only to the DateField in order to change the configuration.
250 247
 
251 248
 	:::php
252  
-	$dateField->setConfig('showCalendar', true);
  249
+	$dateField->setConfig('showcalendar', true);
253 250
 
254 251
 Set *showCalendar* to true to have a calendar appear underneath the Date field when you click on the field. 
255 252
 
@@ -424,44 +421,6 @@ This will change the icons for the pages in the CMS.
424 421
 
425 422
 ![](_images/icons2.jpg)
426 423
 
427  
-### Allowing comments on news articles
428  
-
429  
-A handy feature built into SilverStripe is the ability for guests to your site to leave comments on pages. We can turn
430  
-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
431  
-*ArticlePage*s.
432  
-
433  
-![](_images/comments.jpg)
434  
-
435  
-We then need to include *$PageComments* in our template, which will insert the comment form as well as all comments left
436  
-on the page.
437  
-
438  
-**themes/tutorial/templates/Layout/ArticlePage.ss**
439  
-
440  
-	:::html
441  
-	...
442  
-	<div class="newsDetails">
443  
-		Posted on $Date.Nice by $Author
444  
-	</div>
445  
-	$PageComments
446  
-	...
447  
-
448  
-
449  
-You should also prepare the *Page* template in the same manner, so comments can be enabled at a later point on any page.
450  
-
451  
-![](_images/news-comments.jpg)
452  
-
453  
-It would be nice to have comments on for all articles by default. We can do this with the *$defaults* array. Add this to
454  
-the *ArticlePage* class:
455  
-
456  
-	:::php
457  
-	static $defaults = array(
458  
-		'ProvideComments' => true
459  
-	);
460  
-
461  
-
462  
-You can set defaults for any of the fields in your data object. *ProvideComments* is defined in *SiteTree*, so it is
463  
-part of our *ArticlePage* data object.
464  
-
465 424
 ## Showing the latest news on the homepage
466 425
 
467 426
 It would be nice to greet page visitors with a summary of the latest news when they visit the homepage. This requires a

0 notes on commit 18a1cc1

Please sign in to comment.
Something went wrong with that request. Please try again.