1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » Allow comments - change default to off? [SOLVED]
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 2430 Views |
-
Allow comments - change default to off? [SOLVED]

4 November 2009 at 1:01pm Last edited: 25 November 2009 3:21pm
For each blog entry, in the Behaviours tab, there is a tickbox defaulting to 'allow comments.'
Where can I change the default?
Does anyone know?
TIA
-
Re: Allow comments - change default to off? [SOLVED]

4 November 2009 at 1:08pm
In BlogEntry.php at the top it is set in the $defaults array(). Look for something like
static $defaults = array(
'AllowComments'....Set that to 0 / false to disable the comments by default.
-
Re: Allow comments - change default to off? [SOLVED]

4 November 2009 at 1:17pm
Thanks Willr - superfast!
-
Re: Allow comments - change default to off? [SOLVED]

7 January 2011 at 12:00pm
AllowComments didn't work for me, although ProvideComments did
-
Re: Allow comments - change default to off? [SOLVED]

1 March 2011 at 11:05pm
This no longer works for me.
BlogEntry/php
static $defaults = array(
"ProvideComments" => false,
'ShowInMenus' => false
); -
Re: Allow comments - change default to off? [SOLVED]

8 April 2011 at 2:09am
Me neither - anyone got any suggestions?
-
Re: Allow comments - change default to off? [SOLVED]

15 June 2011 at 2:35am
It did work for me, but I'm not a fan of changing the code in an external module, especially if pulling it in using svn:externals (or the git equivalent). Any fresh installation or update could potentially restore the change unnoticed.
A more sensible way to override the default is to add this line of code to mysite/_config.php:
BlogEntry::$defaults["ProvideComments"] = false;
| 2430 Views | ||
|
Page:
1
|
Go to Top |





