[pmwiki-users] Wayward Group Creation

Kurt Devlin kurt.devlin at gmail.com
Mon Nov 6 09:51:40 CST 2006


I have a good number of novice users that are creating pages dealing with
the XML content that they work with. Unfortunately, a lot of the XML
elements follow a dot separated naming convention. This does not translate
well to wiki page creation. If have a lot of situations where users create a
page like "Unhandled Case in para.text Element". Instead of creating the
desired page, this creates a "Text Element" in the wayward group, "Unhandled
Case In Para". To combat this, I created a custom Site/PageNotFound page
(see below) that tries to determine if the group in the page request exists
or not. If the group doesn't appear to exist, it generates additional
warnings.

My problem is that this approach does not work if the user is creating a
page that is generated from a template. This happens off of the Issues page
in MyGroup (see local/MyGroup.Issues.php below). In this case, there is no
checking that happens, so my users can create new groups without warning.

My questions are:

   - Is there a way to add PageNotFound functionality to pages created
   from templates?
   - Is there an easier way to check the existence of a group besides
   "(:if ! [ exists {$Group}.{$Group} or exists {$Group}.HomePage ] :)"?
   - Is there an easy way to identify the user adding the new page and do
   conditional processing based on their name?

Regards,
Kurt

Site/PageNotFound
(:nolinkwikiwords:)
(:if name {$SiteGroup}.PageNotFound:)
-> %green font-style:italic% This page contains the text to be displayed
when PmWiki is unable to locate a requested page.  Administrators can edit
this page to change the message.
(:if:)
(:if !group Category :)
>>important<<
The page "{$RequestedPage}" doesn't exist.
>><<
(:if:)
(:if ! [ exists {$Group}.{$Group} or exists {$Group}.HomePage ] :)
>>warning<<
It looks like the group "{$Group}" may not exist. \\
Please check that you didn't include an unintentional '''dot''' ('''.''') or
'''slash''' ('''/''') in your link name.
>><<
(:if:)
(:if auth edit :)
Do you want to create the page you requested?
* %rel=nofollow% [[{$FullName}?action=edit | Create {$FullName}]]
(:if ! [ exists {$Group}.{$Group} or exists {$Group}.HomePage ] :)
''''' - OR - '''''
Do you want to create a main page for the new group you requested?
* %rel=nofollow% [[{$Group}.{$Group}?action=edit | Create
{$Group}.{$Group}]]
* %rel=nofollow% [[{$Group}.HomePage?action=edit | Create
{$Group}.HomePage]]
(:if:)
(:if:)

local/MyGroup.Issues.php
<?
    $LinkPageCreateFmt = "<a class='createlinktext'
    href='\$PageUrl?action=edit&amp;template=Site.IssuesTemplate
'>\$LinkText</a>
    <a class='createlink' href='\$PageUrl?action=edit&amp;template=
Site.IssuesTemplate'>?</a>";
?>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20061106/a20fa301/attachment.html 


More information about the pmwiki-users mailing list