[pmwiki-users] How to support case in-sensitive Wiki page names

John Rankin john.rankin at affinity.co.nz
Sun May 14 19:35:51 CDT 2006

On Sunday, 14 May 2006 3:17 AM, Crisp, Steve [UK] <SCRISP at ngms.eu.com> wrote:
>Any takers on this one?  Perhaps I have to modify the core PmWiki code?

Depending on your file naming convention, a local customisation
might be possible. It won't make pagenames case-insensitive, but
it should make your pages more "findable".

If your converted pages are all of the form Group.Pagename -- ie
the first letter of the name is capitalised, but other letters are
lower case, I think it can be done via a local $MakePageNameFunction
without changing pmwiki itself.

You need to make a local copy of function MakePageName and add
an extra test that checks to see whether a page exists with the
first letter capitalised and others all lower case. This will
cause (for example) [[TestFile]] to refer to Group.TestFile if
it exists, but if not it will find Group.Testfile, if it exists.

Something like this: change the last line of the function

  return "$group.$name";

This becomes:

  $altname = $name[0] . strtolower(substr($name, 1));
  return (PageExists("$group.$altname")) ? 
         "$group.$altname" : "$group.$name";

Then your config.php needs to add the line

$MakePageNameFunction = 'AltMakePageName'; 
(assuming you called the local function AltMakePageName)

Hope this helps
>> -----Original Message-----
>> From: pmwiki-users-bounces at pmichaud.com [mailto:pmwiki-users-
>> bounces at pmichaud.com] On Behalf Of Crisp, Steve [UK]
>> Sent: 11 May 2006 18:55
>> To: pmwiki-users at pmichaud.com
>> Subject: [pmwiki-users] How to support case in-sensitive Wiki page
>> All,
>> Q: How does one support case in-sensitive Wiki page names on UNIX?
>> Problem:  I have automatically converted a load of html files to Wiki
>> pages.  All page names start with a Capital letter.  My wiki site has
>> been developed under Windoze so various have been inconsistent when
>> using wiki markup.  For example to reference a file called "Testfile"
>> may have used:
>> * [[Testfile]]
>> * [[testFile]]
>> * [[TestFile]]  (:comment politically correct version:)
>> * [[Test File]] (:comment other combinations of above with space
>> On Windoze all works great.  Now we have moved to a UNIX O/S, proper
>> recognition is given to capitalisation.
>> Does anyone have a 'simple' config extention to plug-in to PmWiki
>> it case in-sensitive when looking up pages?  I read
>> 'AlternateNamingScheme'.  Anything there I can use (I was a little
>> confused)?
>> My Config:
>> * Latest PmWiki
>> * Only Views and TitleDictIndex cookbook extensions
>> Thanks in advance for any assistance,
>> -Steve.

John Rankin

More information about the pmwiki-users mailing list