[Pmwiki-users] Suggested change to pgcust.php

John Rankin john.rankin at affinity.co.nz
Tue May 13 16:51:13 CDT 2003


Proposal:
change the line that reads
    $group =3D FmtPageName('$Group',$pagename);

to
    if (preg_match("/^($GroupNamePattern)[.\\/]?\$/",$pagename,$match)) {
        $group =3D $match[1];
    } else {
        $group =3D FmtPageName('$Group',$pagename);
    }

Rationale:
When PmWiki encounters a reference to a bare group name, such as in the =
header or search result list or an author enters a group name in the =
browser subject line, it looks for:
- a page called Group.Group
- a page called Group.$DefaultTitle (such as Group.HomePage)
- the $DefaultPage

If an administrator wants to change $DefaultTitle on a per-group basis, =
the logical place to do this is in local/Group.php.

A call to FmtPageName('$Group',$pagename) with a $pagename of the form "=
Group[.\\/]?" returns '' so $DefaultTitle doesn't get set and clicking on =
a group takes you to $DefaultPage.

To get pgcust.php to read the local/Group.php and set $DefaultTitle it =
needs the above change.

On the other hand:
Now that I think I understand what's going on, I'll probably standardise =
on Group.Group or Group.HomePage as the starting point for each group.
--=20
John Rankin







More information about the pmwiki-users mailing list