+} #}}}
+
+my $form;
+sub pagetemplate (@) { #{{{
+ my %params=@_;
+ my $page=$params{page};
+ my $template=$params{template};
+
+ # Add search box to page header.
+ if ($template->query(name => "searchform")) {
+ if (! defined $form) {
+ my $searchform = IkiWiki::template("searchform.tmpl", blind_cache => 1);
+ $searchform->param(searchaction => $IkiWiki::config{cgiurl});
+ $form=$searchform->output;
+ }