[pmwiki-users] Group name based $XLLangs (multilanguage Wiki)?
Patrick R. Michaud
pmichaud at pobox.com
Sun May 22 13:19:13 CDT 2011
On Sun, May 22, 2011 at 05:27:34PM +0200, Peter Bowers wrote:
> Could someone comment on the relative merit of putting this in
> conjunction with
> to try to give people an option:
> add to config.php towards the top:
> if (!$pagename) $pagename = $DefaultPage;
> $pagename = preg_replace('/\.html$/', '', $pagename);
> list($group, $name) = preg_match('/^(.*?)[.\/](.*)$/', $pagename);
The correct solution for getting/setting the group and
pagename in config.php is already given at
## Get the group and page name
$pagename = ResolvePageName($pagename);
$page = PageVar($pagename, '$FullName');
$group = PageVar($pagename, '$Group');
$name = PageVar($pagename, '$Name');
Note that ResolvePageName() will already strip a ".html" suffix from the
request url if it happens to exist.
> I'm still not convinced this solves 100% of the issues, but presumably
> takes it a lot closer... Not being confident that it covers enough of
> the instances I hesitate to document it in PmWiki/LocalCustomizations.
The example given above doesn't cover partial pagenames -- i.e., where
a group is given without a page within a group. It also doesn't honor
various configuration settings that affect page name formatting.
More information about the pmwiki-users