Hi All - Is there a way to create a list of tags and require users to select at least one when posting? I’m basically trying to get members to say what product they use when they post …
Hey!
No, there is no feature which will let you force users to add tags.
Usually your categorization is already defining which product a user is talking about. However that must not always be the case...
A tip that I can give you is to adjust the placeholder text in the editor, e.g. “please name the product your question is about” or something like that. All details about it can be found here, but let me know if you have additional questions or issues setting this up.
Also, if you would like a feature as you have described, feel free to submit it as an idea! :)
Orrrr you can vote for this,
Your use-case will fit there, too :)
Cheers,
Ditte
Hi. Is this still the case? Hoping it’s possible to make Tags a required field instead of optional one when posting.
There is a “hack” for this. I tested it and decided we probably didn’t need to use immediately. But I found the code. This create creates a MutationObserver to monitor changes on the page. It goes in the “After <Body>” section. When the page is loaded an initial check is carried to see if there are any tags. If not, then the button is rendered useless. It is only “switched on” when a tag is entered.
Give it a try. It is not perfect, but is should enable this functionality….
<style>
.create-disabled {
pointer-events: none;
opacity: 0.5;
cursor: not-allowed;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
const wrapper = document.querySelector('.public-tag-wrapper');
const button = document.getElementById('topic_save');
// Update the create button's state
function updateButtonState() {
const tags = wrapper.querySelectorAll('.public-tag_selected-tag-name');
if (tags.length === 0) {
button.classList.add('create-disabled');
button.disabled = true;
} else {
button.classList.remove('create-disabled');
button.disabled = false;
}
}
// MutationObserver - watching for changes in the page
const observer = new MutationObserver((mutations) => {
updateButtonState();
});
// Look for all changes:
const config = { childList: true, subtree: true };
// Start observing
observer.observe(wrapper, config);
// Call on page load
updateButtonState();
});
</script>
Hi
Make sure you play around with this in your sandbox before putting it live. There are other bits you may want to add. For example, a message to indicate that tags are required, etc.
One of the reasons we did not implement this is that it didn’t fulfil our requirement on its own. What we wanted was to have “types” of tag. Without going into too much detail, it was an idea of having some tags as required (or one or more of the type of tag to be selected) and others to be adhoc. To implement this it would have added a whole load of extra code to this. Since our Community is new, we decided to learn from our audience before going to extreme levels of customisation.
But if you want to force your users to select at least one tag, this will prevent them from saving a post without selecting one. But as I said, you will want to alert them to this.
Reply
Sign up
If you ever had a profile with us, there's no need to create another one.
Don't worry if your email address has since changed, or you can't remember your login, just let us know at community@gainsight.com and we'll help you get started from where you left.
Else, please continue with the registration below.
Welcome to the Gainsight Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.