Allow capitalisation in tags

Stuart Wright

Well-known member
I would like to allow tags to have capitals.
People ignore tags so much when they can be such a powerful way of finding content.
I'm currently planning on using tags to indicate which platforms games are available on. But having a tag of Xbox One is, when quickly glancing, much more readable than xbox one. PS5 vs ps5. It might seem like a minor difference, but honestly, I think it's important.

I understand the justification of lowercasing them being that they are then consistent.
However, if a new tag is created with a case, say Sony, and then someone creates a thread and uses a tag sony (despite the upper cased existing being suggested), then the all lower case version gets saved as the existing version with the capital S.

Searches should be case insensitive, anyway.

Is there any other problem with having cases in tags?

If not, then I request that we remove the lower case conversion and add the check to save tags as the existing case version when tags are saved in threads.
 
Upvote 16
+1

In my forum I use tags to define themes of books and authors and the lowercase tag is not always the best.

The solution of changing the format with CSS is not a solution either because not all words should always be displayed in titlecase (although I currently use this formula because it's a little better than showing everything in lowercase)
 
Could you use css as a text transform? I've not tried, but it's the first thing I thought of.

Example

div.a {
text-transform: uppercase;
}

div.b {
text-transform: lowercase;
}

div.c {
text-transform: capitalize;
}
 
¿Podrías usar CSS como transformación de texto? No lo he probado, pero es lo primero que se me ocurrió.

Ejemplo

div.a {
transformación de texto: mayúsculas;
}

div.b {
transformación de texto: minúsculas;
}

div.c {
transformación de texto: capitalizar;
}


In my forum I use it, but it is not entirely useful because not all words should start with a capital letter.

For example, if I use a tag for the author of a book, I would like it to show as "Pedro de la Rosa Martínez (author)", not as "Pedro De La Rosa Martínez (Author)".
 
In my forum I use it, but it is not entirely useful because not all words should start with a capital letter.

For example, if I use a tag for the author of a book, I would like it to show as "Pedro de la Rosa Martínez (author)", not as "Pedro De La Rosa Martínez (Author)".
Thats true. It should definitely respect capitals - there will be use cases for caps/non caps/multiple uses per tag. It sort if fits with the old #whatever idea but has more powerful uses.
 
Thats true. It should definitely respect capitals - there will be use cases for caps/non caps/multiple uses per tag. It sort if fits with the old #whatever idea but has more powerful uses.
As far as I can tell, allowing capitals in tags is a relatively easy change, and I'm investigating adding that functionality to Tag Essentials.
Having multiple tags with the same letters but different capitals is harder because then you have different entries in the database and if Xenforo is using a case insensitive search of the database to match entered tags (as I suspect) then we'd have to change the search and likely more aspects of tag processing to cater for this scenario.
So my implementation would not allow multiple variants of the same letters but with different capitals.
 
As far as I can tell, allowing capitals in tags is a relatively easy change, and I'm investigating adding that functionality to Tag Essentials.
Having multiple tags with the same letters but different capitals is harder because then you have different entries in the database and if Xenforo is using a case insensitive search of the database to match entered tags (as I suspect) then we'd have to change the search and likely more aspects of tag processing to cater for this scenario.
So my implementation would not allow multiple variants of the same letters but with different capitals.
HI Stuart, did you get round to adding this functionality? Allowing capitalisation of tags?
 
personally i dont like the idea, its more admin work for synonyms and such....im fine with lower cased acronyms etc
f.y.i. my 2 cents.....or perhaps an option to allow it or disallow really then everyone can have their way.
 
This is a bad idea from an SEO perspective.

Tags are generally used for categorising content for SEO purposes and discoverability purposes. They are deliberately normalised to lowercase to reduce duplication.

Allowing capitalisation will see the tags Xbox and xbox considered two separate tags, even though Google considers them to be the same thing - thus leading to duplicate content which is generally a bad thing from an SEO perspective.
 
Is it not possible to allow capitalization and prevent duplicate tags with different/no capitalization?
Yes, that's possible.

In fact the existing code works just fine with capitalized tags, it just does not allow creating such tags.
But if there are such tags in the DB XenForo will use them.

So if you really wanted to have Sony as a tag and there already is a tag sony it should be possible to just update this in xf_tag
Would need some script or further queries though to also update denormalized caches in xf_thread etc.
 
I think the cleanest way to implement something like this would be to simply add a new "tag_display" (or similar) column which allows the admin/moderators to optionally add an alternative visual display for certain tags, so the database lookup, URLs, etc would all remain lowercase, but the visual display could be set to show with the appropriate case.

If a user enters Sony as a tag, it would be stored as lowercase in the tag and tag_url columns, but stored as entered by the user in the tag_display column.

I mean, you could probably do it just with allowing the values in the tag column to be either case - but you're then relying on users to keep the collation of the column case insensitive so that the unique index works as expected - which I think may potentially introduce unexpected bugs, so probably more robust to have a separate display column?
 
Back
Top Bottom