]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/template.pm
improved, possibly faster getelementsbyclass by willu
[git.ikiwiki.info.git] / IkiWiki / Plugin / template.pm
index a6e34fcc9935546fca9cf0bbf136abee3887af42..c33dbbb83b8d1623ffd1348667247ec3be04f082 100644 (file)
@@ -16,7 +16,7 @@ sub preprocess (@) { #{{{
        my %params=@_;
 
        if (! exists $params{id}) {
-               return "[[template ".gettext("missing id parameter")."]]";
+               error gettext("missing id parameter")
        }
 
        my $template_page="templates/$params{id}";
@@ -42,9 +42,11 @@ sub preprocess (@) { #{{{
                );
        };
        if ($@) {
-               return "[[template ".gettext("failed to process:")." $@]]";
+               error gettext("failed to process:")." $@"
        }
 
+       $params{basename}=IkiWiki::basename($params{page});
+
        foreach my $param (keys %params) {
                if ($template->query(name => $param)) {
                        $template->param($param =>