[pmwiki-users] Looking for a recipe I can steal -- Create a page with no user interaction.

Hans Bracker hans.bracker at googlemail.com
Tue Aug 1 10:54:51 CDT 2006


On 01/08/06, Tegan Dowling <tmdowling at gmail.com> wrote:
> I gather (but often "gather" incorrectly) that I put these into config.php:
>       $EnableAutoGroupPages = 1;
>       SDV($AutoGroupPagesFmt, array(
>       '{$Group}.HomePage' => 'Templates.MyPage1',
>       '{$Group}.HomePage' => 'Templates.MyPage2',
>       '{$Group}.HomePage' => 'Templates.HomePage',
>       '{$Group}.GroupHeader' => 'Templates.GroupHeader',
>       '{$Group}.GroupFooter' => 'Templates.GroupFooter'));
>       include_once("$FarmD/cookbook/newgroupbox.php");

should be in config.php:
       $EnableAutoGroupPages = 1;
       $AutoGroupPagesFmt = array(
          '{$Group}.MyPage1' => 'Templates.MyPage1',
          '{$Group}.MyPage2' => 'Templates.MyPage2',
          '{$Group}.HomePage' => 'Templates.HomePage',
          '{$Group}.GroupHeader' => 'Templates.GroupHeader',
          '{$Group}.GroupFooter' => 'Templates.GroupFooter',
          );
       include_once("$FarmD/cookbook/newgroupbox.php");

> And then on a group-launching page, I'd put the form:
> (:newgroupbox base=HomePage template=Templates.HomePage save=true:)

could just be:
(:newgroupbox save=true:)
or for a different display style:
(:newgroupbox label=Go button=right value="Create new group"
focus=true save=true:)

> Then entering FirstLast into the form and clicking the button will
> create FirstLast/HomePage, FirstLast/MyPage1, etc (all the pages in my
> customized array), pre-populating the new pages with content from the
> corresponding pages in the Templates group.  Is that correct?

Yes.

> With these options in my config, do I not even need to specify base=
> and template=?

You don't need to.

> Am I right in thinking that if I enable the AutoGroupPages option in
> my config, then I can't use the newgroupbox in the original way - for
> instance, I can't, in some other place in the same wiki, put a box
> (:newgroupbox base=Index template=Site.IndexTemplate:)
> ?

Well you can do that, and it will create the page NewGroup.Index with
content from IndexTemplate, but it will also create all the other
pages in the new group!
maybe this si not too friendly, and I should restrict AutoGroupPages somewhat.
autogrouppages get also created if you don't use newgroupbox, and are
creating a new page in a new group manually.

Best,
~Hans




More information about the pmwiki-users mailing list