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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

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

Want to remove the add comments option from a posting


Go to End


5 Posts   4277 Views

Avatar
GaryH2UK

Community Member, 4 Posts

16 August 2009 at 6:57pm

I'm a newbie to php and silverstripe trying to set up a village website. I want the front page to be mainly news stories. There is no need for people to add comments so I would like to remove this option. Could someone guide me through this. Thanks

Avatar
baba-papa

Community Member, 279 Posts

17 August 2009 at 4:26am

In the backend is a checkbox to allow comments.

Avatar
GaryH2UK

Community Member, 4 Posts

17 August 2009 at 5:03am

Thanks for the response. So obvious - I was looking at the 'Blog Holder' page thinking that the pages in the blog would take on its properties from that.

Is there anyway I can set the default to be ' Don't allow comments on this page' or do I have to change it for every entry?

Avatar
dhensby

Community Member, 253 Posts

17 August 2009 at 6:08am

Edited: 17/08/2009 6:09am

Hi GaryH2UK, welcome to SilverStripe.

Being new you will find the tutorials very useful, see: http://doc.silverstripe.com/doku.php?id=tutorials

They will answer most of these questions for you as well as help you learn how to do new things.

However, this is what needs to be added to you PageType.php file in the /mysite/code/ directory (where PageType is the page type of the page you want to turn off comments):

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

see: http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site

Hope that helps!

Avatar
GaryH2UK

Community Member, 4 Posts

17 August 2009 at 7:30pm

Worked a treat, thankyou.