Disable Allow Comments

Posted by Community Admin on 03-Aug-2018 20:27

Disable Allow Comments

All Replies

Posted by Community Admin on 19-Mar-2012 00:00

Is there a way to easily disable the allow comments checkbox (leaving it unchecked) so that my contributors will not accidentally leave this checked when they add news or events?

SF 5.0

Posted by Community Admin on 20-Mar-2012 00:00

Hi,

You can control where the AllowComments custom filed appears, so it'll be very easy to hide it from the edit/create item screen - just go to Content -> News/Blogs and click on Custom fields for News (or Blog Posts) located in the lower right part of the screen. Select the Allow Comments field, and in Appearance set it to be hidden (or alternatively to appear only on edit.create). Save the changes and observe the field will no longer be visible for editing.

Regards,
Boyan Barnev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Jul-2014 00:00

That didn't work for me - I think because it is checked by default so even though we don't see it, it is being saved checked as yes.

Posted by Community Admin on 03-Jul-2014 00:00

Hi Elizabeth,

We have answered you in the support ticket. Please, continue the communication there. Feel free to share the solution with the community after that.

Regards,
Nikola Zagorchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 29-Jul-2015 00:00

Could you please post the solution to this? I'm having the same issue. I want the allow comments just to be unchecked by default, but still leave it displayed so that it can be checked if preferred.

Posted by Community Admin on 03-Aug-2015 00:00

Hello Brett,

We have answered you in the support ticket. Feel free to share the solution provided there for changing the default value of the AllowComments checkbox.

Regards,
Nikola Zagorchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 10-Dec-2015 00:00

Hi I would like to see the solution also,  I want to leave open the option to comment, but to be  un- checked by default.

Posted by Community Admin on 11-Dec-2015 00:00

Hello,

In order to uncheck the checkbox for AllowComments, you need to plug in the DetailsFormView of the module for which you will change the fields loaded. This way you can modify the fields loaded and change their values. In order to uncheck the AllowComments, please use the bellow extension script:

Copy Code
function OnDetailViewLoaded(sender, args)
    // the sender here is DetailFormView
    var currentForm = sender;
 
    uncheckAllowComments(currentForm.get_fieldControlIds());
;
 
function uncheckAllowComments(fieldControlsIds)
    var allowCommentsCheckBox = null;
    for (var i = 0; i < fieldControlsIds.length; i++)
        var id = fieldControlsIds[i];
        if (id.indexOf('allowComments') != -1)
            allowCommentsCheckBox = $find(id);
            break;
        
    
 
    if (allowCommentsCheckBox != null)
        var handlerDataBound = this.createDelegate(allowCommentsCheckBox, uncheckCheckBox);
        allowCommentsCheckBox.add_dataBound(handlerDataBound);
    
    else
        throw Error("AllowComments checkbox cannot be found!");
    
;
 
function uncheckCheckBox()
    this.set_value(false);
;
 
// From Microsoft.Ajax - Function.createDelegate
function createDelegate(a, b)
    return function () return b.apply(a, arguments)
;

In order to set the extensions script, go to News -> Controls -> Newsbackend -> NewsBackendInsert -> Scripts -> create new.
Script Location: set the location of the script, for instance ~/NewsDetailsExtensionScript.js
For loading method set OnDetailViewLoaded.


Regards,
Nikola Zagorchev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 13-May-2016 00:00

In Sitefinity 5.4 you can disable comments by default for new news items through the advanced settings:

News > Comments Settings > AllowComments =  False

I don't know if this applies to earlier versions too.

Posted by Community Admin on 13-May-2016 00:00

Hello Ruth,

You can still do that in newer versions, but it disables the comment globally not per item.

Regards,
Nikola Zagorchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed