[pmwiki-users] Hg now with clean urls...

The Editor editor at fast.st
Tue Feb 6 06:07:05 CST 2007

Great news!  Seem to have gotten the $hglinkprefix working as
intended.  By adding these lines to any subgroup config file
(Main-Test.php for example), you can make all links refer to pages
within Main-Test (without having to type it in), and simultaneously
limit the links to only one more subgroup level, as if Main-Test were
a completely separate wiki.

$hglinkprefix = 'Test-Main';
$ROSPatterns ['/\\[\\[([^\\:]){1}(.*?)\\]\\]/i'] = '[[:$1$2]]';

That is if on Test-Main.HomePage you get this effect:

[[Hi]] => ROS [[:Hi]] => LINK [[Test-Main.Hi]]
[[Hi.]] => ROS [[:Hi.]] => LINK [[Test-Main-Hi.HomePage]]
[[Hi.Two]] => ROS [[:Hi.Two]] => LINK [[Test-Main-Hi.Two]]

It allows you to create a link to pages in other parts of the site by
prefixing the link with double colons.  So in the same group:

[[::Main.]] => ROS [[::Main.]] => [[Main.HomePage]]


P.S. I just uploaded the code changes to the beta version of Hg
(farther on down the page).  I'd like to replace the base Hg with this
recipe in the next 24 hours if no one spots any problems, so please
take a look and test it out.  Very cool!

More information about the pmwiki-users mailing list