[pmwiki-users] Automatic file creation
Ian MacGregor
lists at imacgregor.com
Wed Jun 13 22:40:34 CDT 2007
On Wednesday 13 June 2007 6:39:24 pm Tegan Dowling wrote:
> On 6/13/07, Ian MacGregor <lists at imacgregor.com> wrote:
> > Is it possible to have this:
> >
> > when I create a new $group.Page, I'd like $group.HomePage,
> > $group.GroupHeader
> > and $group.GroupFooter to automatically be created also. This would save
> > me
> > some time. And I'm thinking I could save even more time by creating those
> > files from templates because my $group.HomePage and
> > $group.Group{Head|Foot}er
> > files all have the same content.
> >
> > Is this possible? If so, how do I go about this?
>
> There are several things that you can combine for this.
>
> See http://www.pmwiki.org/wiki/Cookbook/EditTemplates
>
> Also, there's Hans's fantastic recipe
> http://www.pmwiki.org/wiki/Cookbook/NewGroupBox, which is built on
> http://www.pmwiki.org/wiki/Cookbook/AutoGroupPages
> ,
Thank you. What I did was:
1. For auto-creation of $group.GroupHeader pages:
$GroupHeaderFmt = '(:include {$SiteGroup}.SiteHeader basepage={*$FullName}:)
(:nl:)' . $GroupHeaderFmt;
2. For auto-creation of $group.GroupFooter pages:
$GroupFooterFmt = '(:include {$SiteGroup}.SiteFooter basepage={*$FullName}:)
(:nl:)' . $GroupFooterFmt;
from http://www.pmwiki.org/wiki/PmWiki/GroupHeaders
Using two files (Site.SiteHeader and Site.SiteFooter) works better than the 28
seperate $group.Group{Head,Foot}er files I was using. Thanks to Pm for this
great idea :)
3. For auto-creation of $group.HomePage:
$EditTemplatesFmt = '{$SiteGroup}.{$Name}Template';
from http://www.pmwiki.org/wiki/Cookbook/EditTemplates
Regards,
Ian MacGregor
--
http://www.imacgregor.com
MacGregor Despite Them!
More information about the pmwiki-users
mailing list