]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/parentlinks.pm
Merge branch 'master' into sipb
[ikiwiki.git] / IkiWiki / Plugin / parentlinks.pm
index b24eff612ee1146635aede561479df836762d5cd..bdf678069877b3c09bd29894d3f5d6b0353d2619 100644 (file)
@@ -16,6 +16,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1,
                plugin => {
                        safe => 1,
                        rebuild => 1,
+                       section => "core",
                },
 }
 
                },
 }
 
@@ -60,8 +61,11 @@ sub pagetemplate (@) {
         my $page=$params{page};
         my $template=$params{template};
 
         my $page=$params{page};
         my $template=$params{template};
 
-       if ($template->query(name => "parentlinks")) {
-               $template->param(parentlinks => [parentlinks($page)]);
+       if ($template->query(name => "parentlinks") ||
+          $template->query(name => "has_parentlinks")) {
+               my @links=parentlinks($page);
+               $template->param(parentlinks => \@links);
+               $template->param(has_parentlinks => (@links > 0));
        }
 }
 
        }
 }