The Walden Effect: Farming, simple living, permaculture, and invention.

edittemplate

The edittemplate directive is supplied by the [[!iki plugins/edittemplate desc=edittemplate]] plugin.

This directive allows registering template pages, that provide default content for new pages created using the web frontend. To register a template, insert an edittemplate directive on some other page.

[[!edittemplate  template="bugtemplate" match="bugs/*"]]

A recommended place to put the directive is on the parent page of the pages that will be created using the template. So the above example would be put on the bugs page. (Do not put the directive on the template page itself.)

In the above example, the page named "bugtemplate" is registered as a template to be used when any page named "bugs/*" is created. To avoid the directive displaying a note about the template being registered, add "silent=yes".

Often the template page contains a simple skeleton for a particular type of page, wrapped in a templatebody directive. For the bug report pages in the above example, it might look something like:

[[!templatebody  <<ENDBODY
Package: 
Version: 
Reproducible: y/n
Details:
ENDBODY]]

The template page can also contain [[!cpan HTML::Template]] directives, like other ikiwiki templates.

These variables might be set:

Text outside the templatebody directive is not part of the template, and can be used to document it.

If the template does not contain a templatebody directive, the entire source of the page is used for the template. This is deprecated.



Join the Walden Effect!

Download a free copy of Small-Scale No-Till Gardening Basics when you subscribe to our behind-the-scenes newsletter.

Anna Hess's books
Want more in-depth information? Browse through our books.

Or explore more posts by date or by subject.

About us: Anna Hess and Mark Hamilton spent over a decade living self-sufficiently in the mountains of Virginia before moving north to start over from scratch in the foothills of Ohio. They've experimented with permaculture, no-till gardening, trailersteading, home-based microbusinesses and much more, writing about their adventures in both blogs and books.



Want to be notified when new comments are posted on this page? Click on the RSS button after you add a comment to subscribe to the comment feed, or simply check the box beside "email replies to me" while writing your comment.






profile counter myspace



Powered by Branchable Wiki Hosting.

Required disclosures:

As an Amazon Associate, I earn a few pennies every time you buy something using one of my affiliate links. Don't worry, though --- I only recommend products I thoroughly stand behind!

Also, this site has Google ads on it. Third party vendors, including Google, use cookies to serve ads based on a user's prior visits to a website. Google's use of advertising cookies enables it and its partners to serve ads to users based on their visit to various sites. You can opt out of personalized advertising by visiting this site.