Forum Discussion

memerylane's avatar
13 years ago

Thread title consistency

Is it possible to set our community so that those who reply CANNOT change the title of the thread, i.e. only allow it to be "Re: (thread title)"?

 

A number of our users are requesting this, and I personally think it's a better practice than allowing people to change the title in their own replies.


Please let me know if this setting is already possible, or if I should request it via Ideas/Support.


Thanks!

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hey Matt,

     

    Long time no talk! I hope you're doing well!

     

    If you're Studio-inclined, this would actually be pretty easy to accomplish through minor customization. I've come up with two ideas. Both of these ideas rely on keeping the subject field on the page, but preventing the user from editing. This allows the subject value to pass through to the post processing logic.

     

    Idea 1: Hide the field using CSS

     

    You could add some CSS to the skin to hide the field, such as:

    #lia-body.ReplyPage .lia-content .lia-form-subject-entry { display: none; }

    This will keep the field on the page so that the value can be automatically populated and passed through to the form handling when the user submits the post; however, the user will not be able to see the field, preventing them from changing the value.

     

    Idea 2: Disable the field using JavaScript

     

    You could add a component to the ReplyPage that had some JavaScript to disable the field. This would continue to show the field, but would prevent the user from editing it. The contents of the component might look like this:

    <#if page.name?lower_case == "replypage" >
    <@liaAddScript>
    jQuery(document).ready(function() {
      jQuery('#lia-body.ReplyPage .lia-content .lia-form-subject-entry input').attr('disabled','disabled');
    }
    </@liaAddScript>
    </#if>

    Like the previous idea, this will still allow the value to be passed through while preventing the user from editing it.

     

     

    The main difference between these approaches is whether or not you want to continue showing the subject field to the user. Please note that neither of these ideas has been fully tested, so I strongly suggest trying this out in your staging environment first if you decide to go with either of these approaches.

     

    I hope this helps!

      • snaffle's avatar
        snaffle
        Expert

        Hi Adam,

         

        I actually discovered an unintended consequence when I tried implementing this - for some bizarre reason every post started automatically putting the first sentence as the subject.

         

        I've no idea why. At the time I just rolled back my changes with a note to come back to... something I haven't found time to do yet.

         

        So I'd love to know if it works for you or if you have the same issue.

         

        Cheers


        Nathan

    • Would either of these allow a moderator to change a thread subject? We have some very... creative members in our forum, and they can be quite colorful!
      • AdamN's avatar
        AdamN
        Khoros Oracle

        jloyless wrote:
        Would either of these allow a moderator to change a thread subject? We have some very... creative members in our forum, and they can be quite colorful!


        The original examples would hide it for all users. With a little freemarker, you could exclude certain roles if you wanted. For example, with the Idea #2 above, you could do something like:

         

        <#if page.name?lower_case == "replypage" >
           <#assign user_has_role = false />
           <#list restadmin("/users/id/${user.id?c}/roles").roles.role as role>
              <#if role.name?? && (role.name == "Moderator" || role.name == "Administrator")>
                 <#assign user_has_role = true />
              </#if>
           </#list>
        
           <#if user_has_role >
              <#-- do nothing -->
           <#else>
              <@liaAddScript>
              jQuery(document).ready(function() {
                jQuery('#lia-body.ReplyPage .lia-content .lia-form-subject-entry input').attr('disabled','disabled');
              }
              </@liaAddScript>
           </#if>
        </#if>

         

        Again, I highly recommend testing this out in your staging environment first.

  • Don't think so.  There was previous discussion here and a subsequent idea here, but the idea got shuffled into the "Future Review" dustbin.