[pmwiki-users] Different Templates for $Group

Tom Holroyd tomh at kurage.nimh.nih.gov
Thu Mar 10 16:13:27 CST 2005


>             I need different configurations for my different Groups 
> “newpages”.

The trick that I am using is as follows:

I want users to be able to add items to a list, and then have 
different templates for different lists.  Everything is in one group.

So, let's say we are in a group called "Grp".  There's a page called 
"Grp/TheItems" containing a bullet list of items.

Create local/Grp.php, containing:

<?php if (!defined('PmWiki')) exit();

if ($pagename == "Grp.TheItems") {
         $LinkPageCreateFmt =
                 "<a class='createlinktext' 
href='\$PageUrl?action=edit&template=Template.Item'>\$LinkText</a><a 
class='createlink'>?</a>";
}

?>

Put your template in Template/Item.

Now, a user edits the bullet list in Grp/TheItems, and adds a new 
item.  The new page's edit link, when clicked, will automatically load 
the template appropriate for that list.

I'm sure you can see how to apply this to different groups.

-- 
Dr. Tom Holroyd
"A man of genius makes no mistakes. His errors are volitional and
are the portals of discovery." -- James Joyce



More information about the pmwiki-users mailing list