I've got a question on a somewhat similar topic. It seems something
that may be covered elsewhere in documentation, but I can't find it. While in Group1, is there a way to force any NewPage created while editing a page in Group1 to automatically be Group1/NewPage without having to enter the Group1 as part of the name, unless explicitly noted otherwise (ex. Main/NewPage)? IMHO, there ought to be some sort of a groupnewpage toggle in local config that forces new pages created within a group default to that group. I'm constantly goofing up new page creations that are intended for a Group/NewPage, but instead end up in Main/NewPage. For example, I've got a VarsityRoster group with a list of players on the team. I want it so if Joe Player wants to make a player page for themselves, all they need to do is put JoePlayer on the VarsityRoster page, save and then click on JoePlayer and they will end up editing a VarsityRoster/JoePlayer page, not Main/JoePlayer page. A somewhat related question is how can I make it so any new page created in VarsityRoster group comes up with a template for a player page that would make it easy for someone to set up their new player page? $EditTemplateFmt would seem to be what I'm looking for, but the documentation for Edit Template is so muddled, I can't find any clear example of how to make this feature be group specific. For one, the documentation isn't clear to us dummies where one is supposed to put $EditTemplateFmt declarations. Does it go in local config, or in a group home page, or some Site.Group page? So far, my attempts to use $EditTemplateFmt created site wide templates, which is not what is desired. Always, Fred C Patrick R. Michaud wrote: On Tue, Feb 27, 2007 at 04:57:57PM +0000, Hans wrote:Sivakatirswami's question was about blocking new page creations from an existing group.To me, it's not really clear what the original question is asking. His question doesn't say "an existing group", it says "any group": How can one block creation of new pages in any group where, for example, {$Group} = TODO* ??And the subject says "link creation", not "page creation". That's why my response was specifically tailored to answering the question of limiting the creation of groups.So maybe the question needs refining: After initial creation of a number of pages in a group, how can we block creation of any further pages by authors editing the existing pages? Or as the topic subject suggest: How to block link creations in existing groups with a certain groupname pattern?I don't like the phrase "block link creations" -- it sounds as though one is trying to prevent authors from adding links to a page. I think we're trying to prevent the creation of new pages. There's lots of ways to do this. An easy way is to create an $EditFunction that disallows creating new pages: function CreateDisallowed($pagename, $page, $new) { global $EnableCreatePages, $EnablePost, $MessagesFmt; if (IsEnabled($EnableCreatePages, 1)) return; if (PageExists($pagename)) return; $EnablePost = 0; $MessagesFmt[] = 'Creation of new page blocked'; } Then, to block creation of new pages, one simply sets $EnableCreatePages = 0; This can be done in a local/Group.php file to block new pages for that particular group. To block creation of new pages in groups matching a given pattern (say, all groups beginning with 'TODO'): if (preg_match('/^TODO/', $pagename)) $EnableCreatePages = 0; Of course, the CreateDisallowed() function and/or $EnableCreatePages setting can be made more sophisticated -- e.g., to allow admins to create new pages even though others are blocked. Pm _______________________________________________ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users -- Always, Dr Fred C [EMAIL PROTECTED] |
_______________________________________________ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users