We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54043
    • 7 Posts
    Hello,

    I'm trying to add a comments to a page, but I need it to be anonymous comments (person have to type the name manually), but only for a specified group of users. Now when I try to do it, even when I set a name, it takes my username instead of what I've written. I'm using TicketComments, but actually Quip does the same.

    I suppose that it's needed to rewrite some string in TicketComment snippet, but I can't find the string that sets the name.

    I'm sure it's quite easy but my knowledge of php is really poor and I will be really appreciated for help in this.
      • 17301
      • 932 Posts
      It's a little hacky but in your comment tpl you could add this

      <span class="quip-comment-author">[[+authorName:notempty=`Anonymous`]]:</span><br />


      Default tpl path is core/components/quip/elements/chunks/quipcomment.chunk.tpl
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 54043
        • 7 Posts
        Quote from: lkfranklin at Mar 05, 2018, 08:23 AM
        It's a little hacky but in your comment tpl you could add this

        <span class="quip-comment-author">[[+authorName:notempty=`Anonymous`]]:</span>
        


        Default tpl path is core/components/quip/elements/chunks/quipcomment.chunk.tpl

        LK, thank you, but I need to have name to be set, and that's a problem.
          • 17301
          • 932 Posts
          Ah ok. I'm not entirely sure how quip handles this but there is a property to specify a field for the name that is displayed (&nameField=``). You may be able to get away with just adding in another input field into your add comment tpl and pointing to that with the above property - but it may look for a field in the mod user object, not sure.
          [ed. note: lkfranklin last edited this post 8 years, 7 months ago.]
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 46886
            • 1,154 Posts
            You could definitely hack this, why not allow a new field for this name entirely? Because you seem to require a name, but not want it to be the username.

            Assuming LK has started with the original code, hopefully like this:

            <span class="quip-comment-author">[[+authorName]]:</span><br />


            And if you wanted the same consistent behavior, you could allow them to input their new name in your form, and call this [[specialName]]

            and then print that in the form LK identified rather than their 'real' username