New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Feature Proposal: Optional remove restriction that first character of Web / Topic be upper case.


There are times that forced capitalization of topics just doesn't work for the particular application. This was requested in Support.Question1913

Description and Documentation

With full support for Unicode, and possible unicameral languages, forcing the first character of topic or web names to be "upper" doesn't make sense. However this will definitely break existing wiki's, so this needs to be a configuration option.


[[derKezarian]] should result in a topic named derKezerian and not DerKezerian


This breaks any explicit links that depend upon auto-capitalization. For example [[a new topic]] will link to ANewTopic. If this feature is enabled, it will link to either aNewTopic or possibly anewtopic. So this option must not be enabled on an existing Wiki, without careful consideration.

Add new option, with a warning, that enabling the feature can cause issues.
Eliminate ucfirst of the topic name
Eliminate auto-capitalization of [[ link generation ]]
Eliminate the force ucfirst done in the URL parsing
Topic sorting
Currently we do a simple alpha sort on NFKD Topic name. Once lower case topics are allowed, this results in sorting which is confusing. Lower case topic names sort at the end.
Web topic creator needs to not force first character to upper.


Add configure key: {Feature}{EnableLowerCaseTopics}, which conditionally disables the ucfirst call for topic and web names.

Add an lc() call to the sort cmp operation for topic names in Store and Search. This makes the sort results appear much more natural. The issue exists today, but it's not as obvious with the first letter forced to upper.

Add a Preference setting:
If disabled then rendering of [[square bracket links]] will not do any auto-capitalization. The topic name will have spaces will be removed, but no upper case transition.

The code changes are all quite minor.

-- Contributors: GeorgeClark - 17 Jan 2018


Alternative solutions

The DBCachePlugin and activation of the Topic Title somewhat mitigates the issue by allowing the desired name to be stored in the Title metadata.

-- GeorgeClark - 17 Jan 2018

If possible, I would suggest that there is an option for the option to control this effect on a Web-basis, and not only globally. I know I'm being selfish here, but this request is only needed for one Web inside my wiki.

Another suggestion: if ucfirst is disabled, and an existing link would not work, you could add an option to go to the same page with a different case: If you don't find "Foo", then go to "foo".

-- LieVen - 17 Jan 2018

There are two implementation areas:
  1. URL based Web & Topic forcing to ucfirst. This would be a system-wide configuration option. If enabled, the URL becomes will be literally used, without any transformation.
  2. Rendering control of [[link text]]. This makes more sense to be a Site/Web/Topic configuration option. LINKAUTOCAPITAL, defaults to true. Unlike the NOAUTOLINK setting, there would not be an equivalent to the <noautolink> block. With LINKAUTOCAPITAL = 0, anything entered within the [[square bracket links]] would be converted to a topic name without any capitalization. ie "squarebracketlinks". If you want a different results, you would need to use the [[squareBracketLink][square bracket link]] style.

There is a related possibility, should even spaces be removed. There have been requests to permit spaces in topic names. I don't want to complicate this proposal with any growth into that feature.

Regarding auto-resolution of case errors when searching for a topic, there is considerable discussion around an old TWiki proposal TopicCaseSensitivity that would apply. Rather than simply URL and link rendering, this work would be down in the Store and would have much deeper impact. I'll leave that feature out-of-scope for this as well.

-- GeorgeClark - 17 Jan 2018

Another issue with supporting lower case web / topic names, would be possible collisions with the Foswiki installation directory structure. Any directory names would have to be "reserved" Web names.

One possible solution I've tested would be to move the Foswiki webroot down a level
 - bin
 - data
 - lib
 - locale
 - templates
 - tools
 - working
 - webroot
   | - pub

This has the added benefit of being a more secure deployment. It obviates any need to protect individual directories. However it would need some adjustments relative to Tasks.Item14530 (Setting a "RootDir" config variable).

It does require some adjustments to bootstrap. Probing for an alternate pubdir location resolves the issue.

-- GeorgeClark - 30 Jan 2018
Topic revision: r5 - 06 Feb 2018, GeorgeClark - This page was cached on 22 Mar 2018 - 08:15.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License