[pmwiki-users] automatic page titles

aless alessors at gmail.com
Fri Aug 1 04:31:54 CDT 2008

>> [...] Is there any variable that stores
>> "l'aquila" before it is converted to "Laquila" that I can use in a
>> page template or somewhere else to automate the process?
> No. Page names are generated by the function MakePageName.

I thought "the fancy title with spaces" has to be passed somehow to the 
MakePageName function, probably stored in a variable? Anyway, I guess 
this requires tweaking the Pmwiki core, and (programming) languages are 
not one of my skills...

> Unfortunately using link markup you cannot insert the typed title into
> the new pag's (:title :) markup automatically.
> All you could do is specify a template page, which loads as the new
> page. So you can have a blank (:title  :) markup, but you still need
> to fill it. 

Yes, that's the solution I was using. I also found this recipe: 
http://www.pmwiki.org/wiki/Cookbook/EditTitle, but haven't tried it yet.

> A Fox form solution would insert it automatically.
> You could try Fox. http://www.pmwiki.org/wiki/Cookbook/Fox
> See http://www.pmwiki.org/wiki/Cookbook/FoxPageManagement
> example 2

Talking about timing, I had started to read that very page when I 
received your post!

> Apostrophes (single quotes) need to be removed, because PmWiki uses
> page names as file names and in the url. [...]
> You could try and change the $MakePageNamePatterns array, which
> function MakePageName uses. Define it in config.php.

I found also the AlternateNamingScheme recipe in the Cookbook 
(http://www.pmwiki.org/wiki/Cookbook/AlternateNamingScheme), and 
following the instructions I came up with this array that should transform

l'albero di natale => L_albero_di_natale:

$MakePageNamePatterns = array(
     "/'/" => '',                           # strip single-quotes
     "/[^$PageNameChars]+/" => ' ',         # convert non-alnums to spaces
     "/(^\\w)/e" => "strtoupper('$1')",     # initial caps

     "/\\s+/" => '_'                        # Convert spaces to underscores

It's just that for me capitalized words are not that readable, Italian 
and Spanish make far less use of capital letters than English or German.

[from your second post:]
> if readability of page names is important, and you just work with
> European languages, I would not use utf-8, but stick with
> iso, and have special characters converted in the names:
> See http://www.pmwiki.org/wiki/Cookbook/ISO8859MakePageNamePatterns
> Links like [[Español]], [[Français]], [[Überänderung]] will point to
> pages Espanol, Francais, Ueberaenderung instead of the valid url-encoded
> page names Espa%f1ol, Fran%e7ais, %dcber%e4nderung
> (using the ISO 8859-1 character set).

I'm using PmWiki 2.2.0-beta67 in utf-8, but my urls don't show 
url-encoded page names, but page names with accents and non-european 
languages characters too.

I tried with:

- ácèntüadô


- หน้าของ ประเทศไทย (thai text copied from the Google home page)

and they both display correctly (without character conversion) in the 
address bar. Where they get converted is in the file names in the wiki.d 
directory, where I have:

- Main.Ácèntüadô


- Main.หน้าของประเทศไทย

Are the file names supposed to be that way? It makes really difficult to 
  find out what page "Ácèntüadô" is about.

Thanks for the answers, they have been of great help.


PS: I don't know if it's some wrong setting in my list configuration, 
but I'm getting messages from the author and Cced to the list, shouldn't 
they be only to the list, and optionally Cced to the author?

More information about the pmwiki-users mailing list