+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Disable Allow Comments

Disable Allow Comments

10 posts, 1 answered
  1. WebGeek
    WebGeek avatar
    186 posts
    Registered:
    20 Dec 2006
    19 Mar 2012
    Link to this post
    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
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    20 Mar 2012
    Link to this post
    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
    Answered
  3. Elizabeth
    Elizabeth avatar
    83 posts
    Registered:
    23 Mar 2005
    02 Jul 2014 in reply to Boyan Barnev
    Link to this post

    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.

  4. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    03 Jul 2014
    Link to this post
    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
     
  5. Brett
    Brett avatar
    1 posts
    Registered:
    28 Jul 2015
    29 Jul 2015
    Link to this post
    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.
  6. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    03 Aug 2015
    Link to this post
    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
     
  7. Miguel
    Miguel avatar
    1 posts
    Registered:
    01 Dec 2015
    10 Dec 2015
    Link to this post
    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.
  8. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    11 Dec 2015
    Link to this post
    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
     
  9. Ruth
    Ruth avatar
    25 posts
    Registered:
    17 May 2012
    13 May
    Link to this post

    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.

  10. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    13 May
    Link to this post
    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
     
10 posts, 1 answered