Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having Lower-Case Page Titles in Mediawiki

I am building a Mediawiki at here.

It is going OK, but now I want to have some articles to document things that begin with a lower-case letter such as Unix commands: "man", "chmod", "ls", "iPod", etc. I don't want them to show up like Mediawiki tries to make all page titles and article titles begin with an upper-case letter.

Also, I don't want the searches to be case-sensitive. I want searching for "apple" to find "Apple", etc.

I believe that I've achieved having case-insensitive searches by following the instructions from the web page.

I believe that this is good, but I am a little squeamish about what I had to do:

  1. Change the Structure of the database table _pages, changing the type of the page title to be VARCHAR(255) and changing the collation sequencing to be a kind of utf-8 case-insensitive.

  2. Adding a global function to globalFunctions.php.

  3. Changing the php code in the wiki's skin.

It seems like this should just be a php variable in LocalSettings.php

But this all seems to work. I mean, I could enter "apple" and it would find the article on "Apple" rather than prompting me to create a new article called "apple".

But then, I noticed that the page titles were still capitalized for such things as new article such as an article on "chmod".

I went back to googling and I found a web page that said to use the Mediawiki global variable called:

$wgAllowDisplayTitle = true;

and that this would enbled me to use templates such as the following:

{{DISPLAYTITLE:chmod}}

http://www.learnbymac.com/wiki/index.php?title=Chmod

This partially works. The title of the article is now "chmod", but really, in the database the title is still "Chmod" which wouldn't be so bad, but when I go to the Category "Unix", all of the Unix commands show up starting with an upper-case letter.

I read on the Mediawiki site that beginning a page title with a lower-case letter, in any language, is disallowed.

I would like things on my wiki to be like they are on my Mac, not case-sensitive, but case-preserving.

I know that Mediawiki has to consider about every language in the world, but I don't.

I really would rather not modify the structure of my Mediawiki database any further, but maybe that's what's required. I just noticed that not only are the page titles wrong in the category pages, but they are also wrong in the title when you are editing pages.

Here's a link to a category that lists the titles in the wrong case:

---Edit---

I figured it out. I believe that it is fine now. I was missing the following line in my Mediawiki configuration file, called "LocalSettings.php:.

# disable first-letter capitalization of page names
$wgCapitalLinks = false;

I know that I entered this the first time. I believe what happened was the changes got saved in my local file system instead of being saved by my text editor, via ftp, to my website.

like image 537
Kaydell Avatar asked Jul 12 '13 06:07

Kaydell


1 Answers

As you noted, setting $wgCapitalLinks = false; in LocalSettings.php will do the trick. If you already had pages in your wiki, you will probably want to run the maintainence script CleanupCaps as well: http://www.mediawiki.org/wiki/Manual:CleanupCaps.php

For your second question: To have the search case insensitive you can use the TitleKey extension (http://www.mediawiki.org/wiki/Extension:TitleKey). It is stable, and used on many major wikis. There is also the possibility to plug in a the Lucene serach engine, if you want more control over the behaviour (http://www.mediawiki.org/wiki/Extension:MWSearch)

like image 96
leo Avatar answered Oct 21 '22 14:10

leo