<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
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. <br>
<br>
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)? <br>
<br>
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. <br>
<br>
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. <br>
<br>
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? <br>
<br>
$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. <br>
<br>
Always, Fred C<br>
<br>
Patrick R. Michaud wrote:
<blockquote cite="mid20070227171857.GE22280@host.pmichaud.com"
type="cite">
<pre wrap="">On Tue, Feb 27, 2007 at 04:57:57PM +0000, Hans wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Sivakatirswami's question was about blocking new page creations from
an existing group.
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
<blockquote type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<pre wrap=""><!---->
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
<a class="moz-txt-link-abbreviated" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a>
<a class="moz-txt-link-freetext" href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Always, Dr Fred C
<a class="moz-txt-link-abbreviated" href="mailto:drfredc@drfredc.com">drfredc@drfredc.com</a></pre>
</body>
</html>