If you have a comma in the tag, Active Tags won't separate the tags (or better yet, add the tag as soon as it detects a comma). Instead, it spits out an error message.

Thanks for looking into this.

Comments

wrg20’s picture

I added commas using jQuery and CSS.

jQuery(document).ready(function($) {
	var regex = new RegExp('^node-page-');
	$('.node-page').each(function(){
		if(regex.test($(this).attr('id'))){
			var text = $(this).attr('id');
			var num = text.slice(10,14);		
			$('#node-page-'+num+' .field-name-field-tags a') .addClass('commas');
			$('#node-page-'+num+' .field-name-field-tags a:last').removeClass('commas');
		}
	});
});

CSS

.commas:after{content:",";}
chonwil’s picture

To separate tags by commas, just replace the activeTags.addTerm function by the following function:

activeTags.addTerm = function (context, term) {
  // Hide the autocomplete drop down.
  $('#autocomplete').each(function () {
    this.owner.hidePopup();
  });

  // Removing all HTML tags. Need to wrap in tags for text() to work correctly.
  term = $('<div>' + term + '</div>').text();
  term = Drupal.checkPlain(term);
  term = jQuery.trim(term);

  if (term != '') {
	  var terms = term.split(',');
	  for (var i = 0; i < terms.length; i++){
	    var termDiv = $(context);
	    var termList = termDiv.parent().find('.at-term-list');
	    termList.append(Drupal.theme('activeTagsTermRemove', terms[i]));
	  }
    // Attach behaviors to new DOM content.
    Drupal.attachBehaviors(termList);
    activeTags.updateFormValue(termList);
    termList.parent().find('.at-term-entry').val('');
  }

  return false;
};
mahyarsbt’s picture

Assigned: Unassigned » mahyarsbt
Issue summary: View changes
Status: Active » Fixed

Thank you for your continued interest in the Active Tags module.

We are excited to announce that the issue you raised has been addressed in the revitalized Active Tags version 1.0.0. This update supports Drupal 9, 10, and 11 and brings a modern interface along with a range of new features to enhance your Drupal tagging experience, including:

  • Enhanced Tag Styling: Enjoy a modern and visually appealing interface for entity reference fields.
  • Dynamic Tag Creation: Flexibly enable or disable tag creation based on your Drupal settings.
  • Support for User Avatars: Display user avatars in tags when using the User entity autocomplete.
  • Efficient Tag Management: Organize tags effortlessly with drag-and-sort functionality, duplicate protection, and multiple selection support.
  • Entity ID Display: Optionally display the entity ID alongside each tag for added clarity.
  • Integration with Key Modules: Seamlessly integrate with Token, Webform, Facets, and Better Exposed Filters for enhanced filtering and autocomplete functionality.

This is just a glimpse of the new capabilities. We encourage you to explore these new features by downloading the latest version. For a full list of features and more details, please visit the Active Tags project page.

mahyarsbt’s picture

Status: Fixed » Closed (fixed)

With the release of Active Tags 1.0.0, we believe this issue has been fully resolved. We invite you to explore the latest version and share any feedback you have.

Thank you for your continued support and contributions to the Drupal community. Together, we can keep improving Active Tags!


Visit the Active Tags project page to stay updated and provide feedback.