Feature Proposal: Optional case-insensitive sort on form fields for search results
Motivation
On a custom wikipedia-like wiki app, to show the topics in alphabetical order, we needed to sort on the defined term name, in a TWikiForm field, in a case-insensitive ways, as definitions of english terms and acronyms were used
Description and Documentation
I have added an optional "i" at the end of formfield, to be used as order="formfield(FIELD)i" to specify nocase sort
Examples
Impact and Available Solutions
Implementation
I attach a patch for Cairo (tested on latest Cairo) and for Dakar (tested on 4.1.2 & 4.0.4)
The "if" is external to the sort loop so normal sorting is no slower. nocase sorting is however a bit slower than nocase one (we use "lc a cmp lc b" instead od "a cmp b")
Documentation should be updated
--
Contributors: ColasNahaboo
Discussion
--
ColasNahaboo - 13 Mar 2007
Useful enhancement. On syntax, I would not add something to the end after the parenthesis, I would align it with the existing syntax. Either:
- with a comma delimited parameter, such as
order="formfield(NAME, i)",
- or with a new keyword, such as
order="formfieldignorecase(NAME)"
The case sensitive sorting could also be generalized, e.g. not just for the formfield:
- with a new parameter to turn on case insensitive sort,
ordercaseinsensitive="on" order="formfield(NAME)
- or with a new parameter to do case insensitive sort,
ordercaseinsensitive="formfield(NAME)
--
PeterThoeny - 13 Mar 2007