Forum Discussion

damon_williams's avatar
11 years ago

Auto-tag posts in a specific board

We want every new topic in a specific board to automatically get a specific tag, and/or have the 'tags' field pre-populated on the new message page. Is this possible?  
  • Claudius's avatar
    11 years ago

    Hi,

     

    Both is possible, yes.

    1. For the server side automatic tag addition on message creation you might look at subscribing to the "MessageCreate" event and then accessing a custom Community endpoint to add the tag to the newly created message.
    2. The client side JavaScript tag prepopulation is probably easier though by just adding a custom component to the PostMessage page that just adds the tag of your liking in the tag entry field:
      $(document).ready(function() {
          $('#lia-body #lia-tags').val("MyTag");
      }

       You might want to check if the message to be posted is a new topic or a reply.