This question about Configuration: Answered

How can I allow lower case topic names?

I'm still using 1.1.9 (because it works fine) but will upgrade to the actual version next week. Anyway, I didn't find any info on this, so perhabs someone can tell me how to solve it: How can I get lower case page names?

I'll explain why I need this: I am the admin of the Klingon Language Wiki. I am planning to give it a dictionary part explaining the meaning of some words. The problem is: Case is important when writing Klingon; some letters are ALWAYS lower case, others are upper case. Changing them is as strange as it would be in English wRITING lIKE tHIS. Briefly: there are many page names starting with lower case letters.

My next problem would be that Klingon uses the apostrophe as a letter. Unfortunately, the automatic linking removes them, so Qo'noS becomes QoNoS and 'ol becomes Ol - that's absolutely not useful.

-- LieVen - 05 Dec 2017

I wouldn't use Foswiki's concept of CamelCase and auto linking then. Instead, I'd encode the proper writing into a formfield and use the AUTOINC mechanism to generate dictionary entries, while switching off linking using NOAUTOLINK = on globally.

-- MichaelDaum - 05 Dec 2017

Right now the internal architecture does not allow fully lower-case topic names. Even without autolinking, there are many places that expect the first letter of a topic name and web name to be Upper. This is certainly something that we should address as a longer term requirement for unicameral languages, but there is no simple solution today to permit the lower case initial letter.

-- GeorgeClark - 05 Dec 2017

Thanks for your answers. For this same reason I have autolinking deactivated anyway, which is no problem and works fine. But the problem with lower case topic names not being possible really stops my entire project, and if I weren't using foswiki already, it would be a reason for me NOT to choose FosWiki but schoose another one instead. By the way, MediaWiki is able to do so and even allows apostrophes, but I don't want to use that for several reasons. frown, sad smile

-- Lieven - 15 Jan 2018

The solution here lies in Foswiki being open source. The code is published on Github, and we certainly will review and accept reasonable enhancements. We welcome work that improves on the flexibility and usability of Foswiki. I suggest creating a FeatureRequest and signing up to help with the work. There are two distinct issues:

  1. Support of lower case topic names. (And possibly support for lower case Web names)
  2. Support of the apostrophe (or other typographic mark that might be less problematic.)

Note a change of this magnitude would be best suited for Foswiki 2.2 or 3.0. It's a change that could break operation for others and needs careful review. My comments below are applicable to the "master" branch on github.

1 - Lower case topic names.

This dates back to a development decision made in http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/Item3270 - over 10 years ago.
  • Topic names are forced to upper case in Foswiki::Request
  • The code that generates topic names automatically (i.e. [[my new topic]] becomes MyNewTopic) would probably need to be reworked or made a configuration option. Otherwise a change like this would break linking to existing topics.
  • There may be some other places where the upper-case is assumed, but this all needs review and testing.

2 - Support of apostrophe.

This one creates some security concerns. The character is actually filtered out in the $Foswiki::cfg{NameFilter} setting, so it could be allowed. But, in addition, we brute-force truncate any URL containing an apostrophe to prevent any possible attacks caused by termination of strings. That's done in Foswiki::Engine::CGI

I just did a quick test on master. Removing ' from NameFilter, and commenting out that code in CGI.pm, and I was able to create topics containing a ' in the name. But a change like this would need a very deep audit for security implications.

A workaround might be to choose a different unicode character. eg. See this blog entry. Using a character that isn't a perl string delimiter might already work.

Anyway... This all deserves to be in a FeatureRequest. And we gladly welcome the participation of anyone who wants to help develop this.

-- GeorgeClark - 15 Jan 2018

Alternative solution - DBCachePlugin and Topic Title field.

MichaelDaum made another suggestion. Look into installation of the DBCachePlugin. This enables the Topic Title metadata, which allows the actual topic name to be disconnected with the displayed topic title. A database is used to accelerate the lookup between topic name and title. You may need a few skin changes to display the title where the topic name was stored. But this approach solves both the lower case topic name and the quotation issue.
(10:43:39 AM) MichaelDaum: If I was to implement a lexicon for a strange language (such as klingon) would I store writings in a DataForm, i.e. multiple alternative writings.
(10:44:05 AM) gac410: Anyway,   It sounds like he could solve this somewhat by moving to NatSkin ... but that means he has to translate it.   TBH I still think that allowing lower case topic names makes sense.
(10:44:53 AM) MichaelDaum: he probably also wants apostrophes ... looking at http://www.klingonwiki.net/En/Cursing
(10:45:40 AM) MichaelDaum: he doesnt have to move to NatSkin.
(10:45:52 AM) MichaelDaum: only install DBCachePlugin. done.
(10:46:17 AM) MichaelDaum: WebTopicList and WebIndex is easy to fix in System.*
(10:47:05 AM) MichaelDaum: %TOPICLIST{"   * [[%BASEWEB%.$name][$name]]"}% should be %TOPICLIST{"   * [[$name]]"}% actually

-- GeorgeClark - 15 Jan 2018

Note that on Foswiki 2.x, Topic names like Tasks/Testcases.TestʼName work fine. I used the unicode character U-02BC (Entered on linux as Ctrl-Shift-U 0 2 b c [enter] )

-- GeorgeClark - 15 Jan 2018

I'm going to open a FeatureProposal for the lower case topic suggestion. EnableLowerCaseTopicNames

-- GeorgeClark - 17 Jan 2018

Some answers to all of the above comments:

  • @MichaelDaum: I actually AM storing it all in Dataforms; The problem just is that the page names should be usable, and any linking - also from other places - should work easily. But at this time, a link like [[quv]] will link to [[Quv]] which is a different word.
  • Thanks for the TestʼName solution suggestion. This *might* work, but is not a very useful solution for the average users, as the apostrophe is used very often in Klingon, and no casual user knows how to write the ’ (single right quote). It's like telling you not to write the letter "e" any more and type a strange combination instead. :-/
  • Thanks for opening the feature proposal. I am definitely aware that having apostrophes in names can cause a problem, especially as they can deactive or truncate commands.
-- LieVen - 17 Jan 2018

The ' in topic names is not going to work very well. As ' is a delimiter in the macro language, topic names containing that character breaks a number of templates, including the base page template, the Nat editor, the topic search page, just to name a few. Simple things like:
%IF{"'%TOPIC%' allows 'CHANGE'" then=" 

end up with syntax errors. That's a fairly common usage in the default topics and templates. Other than using an alternate character I can't think of a simple solution to this one. Because of the amount of breakage of the normal Foswiki operation, I'm not planning on allowing ' in topic names as a configurable feature.

-- GeorgeClark - 11 Apr 2018
 

QuestionForm edit

Subject Configuration
Extension
Version Foswiki 1.1.9
Status Answered
Related Topics
Topic revision: r9 - 11 Apr 2018, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy