[pmwiki-users] Groups and wikiwords

Patrick R. Michaud pmichaud at pobox.com
Wed Jun 27 11:02:47 CDT 2007


On Wed, Jun 27, 2007 at 02:18:50PM +0100, Stuart Robinson wrote:
> Is there a way to ensure pages created with wikiwords are created under 
> a particular group? 

Yes, see below.

> At the moment, with wikiwords enabled, they appear to inherit the 
> group of the page they were created in. For example,
> If I have a page under Specialgroup.Thispage, and someone creates a 
> page with a WikiWord, the resulting linked page takes the group 'Specialgroup'

That's typically what authors expect, which is why it works this way.  :-)

> Id like to have wikiword generated pages take some other group (or none).
>  
> Is this possible?

Add the following local customization:

  $WikiWordGroup = 'OtherGroup';

  Markup('wikilink', '>urllink',
    "/\\b(?<![#&])($GroupPattern([\\/.]))($WikiWordPattern)/e",
    "Keep('<span class=\\'wikiword\\'>'.WikiLink(\$pagename,'$0').'</span>',
          'L')");

  Markup('wikiwordlink', '>wikilink',
    "/\\b(?<![#&])($WikiWordPattern)/e",
    "Keep('<span class=\\'wikiword\\'>'.WikiLink(\$pagename,'$WikiWordGroup/$0').'</span>',
          'L')");

This causes all (non-group-qualified) wikiwords to link to the group
given by $WikiWordGroup ('OtherGroup' in the example above).  
The first Markup() rule preserves the existing wikiword behavior
for group-qualified wikiwords, the second handles non-group-qualified
wikiwords.

Hope this helps,

Pm




More information about the pmwiki-users mailing list