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.

Blog Module

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Allow comments - change default to off? [SOLVED]


Reply

7 Posts   3153 Views

Avatar
Web Designer Perth

4 November 2009 at 1:01pm (Last edited: 25 November 2009 3:21pm), Community Member, 49 Posts

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

Avatar
Willr

4 November 2009 at 1:08pm Forum Moderator, 5511 Posts

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.

Avatar
Web Designer Perth

4 November 2009 at 1:17pm Community Member, 49 Posts

Thanks Willr - superfast!

Avatar
fabilo

7 January 2011 at 12:00pm Community Member, 10 Posts

AllowComments didn't work for me, although ProvideComments did :)

Avatar
Johan

1 March 2011 at 11:05pm Community Member, 49 Posts

This no longer works for me.

BlogEntry/php

   static $defaults = array(
      "ProvideComments" => false,
      'ShowInMenus' => false
   );

Avatar
mierla

8 April 2011 at 2:09am Community Member, 16 Posts

Me neither - anyone got any suggestions?

Avatar
timwjohn

15 June 2011 at 2:35am Community Member, 98 Posts

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;