Opened 16 years ago
Closed 11 years ago
#4799 closed enhancement (fixed)
TagCloud should optionally be case-insensitive
Reported by: | Jeff Hammel | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | TagsPlugin |
Severity: | normal | Keywords: | TagCloud |
Cc: | Michael Renzmann | Trac Release: | 0.11 |
Description (last modified by )
Because of the use of sorted
in tagsplugin/trunk/tractags/macros.py#L47, upper-case items precede lower-case items. These should optionally be intermingled. Patch attached.
Attachments (2)
Change History (16)
Changed 16 years ago by
Attachment: | macros.py.patch added |
---|
comment:2 follow-up: 8 Changed 15 years ago by
Owner: | changed from Alec Thomas to Michael Renzmann |
---|
Reassign to new maintainer.
From #5347 (which is a duplicate of this), reported by: k0s
currently tags are case-sensitive. while it is desirable to have the ability to use case to denote information (e.g. America vs. plugin), it is undesirable to have different cases be different. That is, Plugin and plugin should be the same tag. I think by default that the first case should be the canonical one. Ideally, a way of managing tags should be implemented that allowed re-casing and canonizing, but a first step would just be treating tags independent of case, at least optionally.
comment:3 Changed 14 years ago by
Keywords: | TagCloud added |
---|
Seems like it aims at a similar thing as #4200 or even might get obsoleted by it.
However the configuration option to retain old/default behavior should definitely be considered. Thanks for contributing your changes.
comment:4 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:5 follow-up: 7 Changed 13 years ago by
This patch is nice and clean, and could easily be rebased againts the current trunk. What do you think about adding the configuration option that controls default behavior of the macro and the tags
page, and also having an option for the ListTagged
macro that can override the default?
comment:6 Changed 13 years ago by
Cc: | Michael Renzmann added; John Hampton removed |
---|---|
Owner: | changed from Michael Renzmann to Steffen Hoffmann |
I'll take care to bring this in now. Ryan, thanks for your vote.
comment:7 follow-up: 11 Changed 13 years ago by
Replying to rjollos:
This patch is nice and clean, and could easily be rebased againts the current trunk.
Right, already done so. But this is more specifically just a caseless sort, not totally caseless treatment - that would include most notably tag consolidation (collecting taggged resources under one tag label, if their tags only differ by case). So I'll rename the option to reflect this: cloud_caseless_sort
What do you think about adding the configuration option that controls default behavior of the macro and the
tags
page, and also having an option for theListTagged
macro that can override the default?
Here you refer to functionality including such tag consolidation as requested by #4200, right? Just looking into it.
comment:8 Changed 13 years ago by
A note for completeness of feature request tracking:
Replying to AdrianFritz:
Reassign to new maintainer.
From #5347 (which is a duplicate of this), reported by: k0s
![...] Ideally, a way of managing tags should be implemented that allowed re-casing and canonizing, but ...
This has been implemented meanwhile by the mass tag replacement functionality for admin users (one-to-one and many-to-one, see #9061).
Changed 13 years ago by
Attachment: | 20111001_tagscloud_case_sorting.png added |
---|
subtle tags cloud case-dependent sorting
comment:9 Changed 13 years ago by
Status: | new → assigned |
---|
Testing the proposed implementation of "caseless" sorting I noticed, that it reversed the order of upper-case and lower-case words while intermingling them.
This is demonstrated in the upper part of my cloud snapshot:
I resorted to a slightly more complicated sort to ensure, that lower-case tags still come after upper-case ones with same letter.
For the special case of tags containing several upper-case letters the result is still not as I'd expect it (notice 'TEST' next to 'test'), but this is just a curiosity of the sort function and doesn't mean more than a minor annoyance to me.
comment:10 Changed 13 years ago by
(In [10736]) TagsPlugin: Allow mixing of upper- and lower-case tags in sorted tags cloud, refs #4200 and #4799.
This is controlled by a new option cloud_caseless_sort
that defaults to
False for backwards-compatibility and doesn't touch the more general issue of
case-sensitive tag handling (in TagsQuery) as detailed in #4200.
Thanks to Jeff Hammel for contributing the code for this enhancement.
comment:11 Changed 13 years ago by
Replying to hasienda:
Right, already done so. But this is more specifically just a caseless sort, not totally caseless treatment - that would include most notably tag consolidation (collecting taggged resources under one tag label, if their tags only differ by case). So I'll rename the option to reflect this:
cloud_caseless_sort
Yes, good clarification. The "consolidation" feature seems to be one of the intents of #8747 as well as #4200.
Here you refer to functionality including such tag consolidation as requested by #4200, right? Just looking into it.
Actually, what I was thinking about here, is allowing control of cloud_caseless_sort
from the ListTagged
macro. For example,
[[ListTagged(-dummy, caseless_sort=true)]]
I've tested r10736 on Trac 0.11.7 and it seems to be working well.
comment:12 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:13 Changed 13 years ago by
Thanks for the hint on #8747, missed that by now, so I'm glad now to not have factored the whole thing by now.
patch to make TagCloud optionally case-insensitive