Opened 15 years ago

Last modified 10 years ago

#4799 closed enhancement

TagCloud should optionally be case-insensitive — at Version 12

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 Ryan J Ollos)

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.

Change History (14)

Changed 15 years ago by Jeff Hammel

Attachment: macros.py.patch added

patch to make TagCloud optionally case-insensitive

comment:1 Changed 15 years ago by Ryan J Ollos

See also #5347.

comment:2 Changed 14 years ago by Adrian Fritz

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 Steffen Hoffmann

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 Ryan J Ollos

Description: modified (diff)

comment:5 Changed 13 years ago by Ryan J Ollos

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 Steffen Hoffmann

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 in reply to:  5 ; Changed 13 years ago by Steffen Hoffmann

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 the ListTagged 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 in reply to:  2 Changed 13 years ago by Steffen Hoffmann

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 Steffen Hoffmann

subtle tags cloud case-dependent sorting

comment:9 Changed 13 years ago by Steffen Hoffmann

Status: newassigned

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: subtle tags cloud case-dependent sorting

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 Steffen Hoffmann

(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 in reply to:  7 Changed 13 years ago by Ryan J Ollos

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 Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.