[pmwiki-users] automatic page titles (aless)

John Rankin john.rankin at affinity.co.nz
Sun Aug 3 20:10:06 CDT 2008


>From: aless <alessors at gmail.com>
>Subject: Re: [pmwiki-users] automatic page titles (aless)
>
>>>  [...]
>
>
>By the way, as a side effect of having the new page naming scheme, the 
>old links are obviously not recognized anymore, for example, most of the 
>pages in the Documentation Index. Should I rename them manually or is 
>there a quicker solution? A renaming script, maybe?

(I got distracted and didn't respond to this issue)

Once you have got new page names working the way you want, there is
a solution to this that doesn't involve renaming old pages :-)

The problem you face is that PmWIki has a MakePageName function
that decides whether a page already exists or is a new page. It
does this by turning [[link text]] markup into a valid page name
and calling a PageExists($pagename) boolean function.

What you are doing is changing the rules for how [[link text]]
becomes a pagename. Instead of getting {$Group}.LinkText [1]
you are getting {$Group}.Link_text. For example, a link to 
[[PmWiki/documentation index]] tries to find a page called
PmWIki.Documentation_index and fails.

So what we have to do is instruct PmWiki to look for 
Documentation_Index *and* DocumentationIndex. From memory the
alternate page naming scheme recipe code does this. I know I
solved this problem at one point, but it was quite a while ago
now and I don't remember the code details (or if I released it 
as a recipe).

I suggest you get the alternate naming scheme working to your
satsfaction first, then look at how to teach PmWiki how to
continuing to recognise links to pre-existing pages. The only
trick will be deciding which page takes precedence if there
are 2 pages, one named LinkText and one named Link_text.
However, since from memory you have WikiWords disabled, this
should not be too much of a problem. The implementation 
details will depend on precisely what capitalisation scheme 
you implement.

Hope this helps
JR

[1] to be precise, it also looks for LinkText.LinkText and 
    LinkText.HomePage, but set these to one side for the
    purposes of this discussion
>
>Thanks for your help.
>
>Have a nice weekend,
>  alessandro
>


-- 
John Rankin
Affinity Limited
T 64 4 495 3737
F 64 4 473 7991
021 RANKIN
john.rankin at affinity.co.nz
www.affinity.co.nz





More information about the pmwiki-users mailing list