[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
> http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#configphp-order
> to try to give people an option:
>
> add to config.php towards the top:
> ===(snip)===
> if (!$pagename) $pagename = $DefaultPage;
> $pagename = preg_replace('/\.html$/', '', $pagename);
> list($group, $name) = preg_match('/^(.*?)[.\/](.*)$/', $pagename);
> ===(snip)===
The correct solution for getting/setting the group and
pagename in config.php is already given at
http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#configphp-group-page
## 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.
Pm
More information about the pmwiki-users
mailing list