2

At the moment use of Tags seems to be case insensitive. So, for example, it is possible to tag an article as both 'IT Support' and 'it support'.

Is it at all possible to make the Tags case sensitive?

2

One option is to use the onBeforeSaveTag event to capture the tag before it is saved. You can then use PHP's strtolower to normalize all of your tags.

In a plugin's main file, your init() function should have something like this:

public function init()
{
    craft()->on('tags.onBeforeSaveTag', function(Event $event) {
        $event->params['tag']->title = strtolower($event->params['tag']->title);
    });

}
2
  • Thanks - wonder if it might just be better using categories so that it is much clearer and there is a wee bit more control over the spelling of the 'tags' we want to use Oct 27 '15 at 16:08
  • 1
    Sounds like a good option @ColeHenley. Tags are best used when you don't care as much about consistency or organization. Oct 27 '15 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.