]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* If the meta plugin overides the page title, set a title_overridden
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 12 Aug 2006 17:51:32 +0000 (17:51 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 12 Aug 2006 17:51:32 +0000 (17:51 +0000)
  variable in the template to true. This allows doing things with the
  templates conditional on the title being overriden.

IkiWiki/Plugin/meta.pm
debian/changelog
doc/download.mdwn
doc/plugins/meta.mdwn
doc/plugins/write.mdwn

index 0890830a77d2a3f9be4329df4fb7f6a92e129a7d..9b026fffa3c3c57480643bb424834abb6e50efbc 100644 (file)
@@ -85,8 +85,10 @@ sub pagetemplate (@) { #{{{
 
        $template->param(meta => $meta{$page})
                if exists $meta{$page} && $template->query(name => "meta");
-       $template->param(title => $title{$page})
-               if exists $title{$page} && $template->query(name => "title");
+       if (exists $title{$page} && $template->query(name => "title")) {
+               $template->param(title => $title{$page});
+               $template->param(title_overridden => 1);
+       }
        $template->param(permalink => $permalink{$page})
                if exists $permalink{$page} && $template->query(name => "permalink");
        $template->param(author => $author{$page})
index 7456780569ee8e81a551e1283afd7ea3540155cb..4e92226facc6822e7c18a542205871add442a441 100644 (file)
@@ -1,3 +1,11 @@
+ikiwiki (1.18) UNRELEASED; urgency=low
+
+  * If the meta plugin overides the page title, set a title_overridden
+    variable in the template to true. This allows doing things with the
+    templates conditional on the title being overriden.
+
+ -- Joey Hess <joeyh@debian.org>  Sat, 12 Aug 2006 13:45:05 -0400
+
 ikiwiki (1.17) unstable; urgency=low
 
   * Disable tidy generator tag.
index 5076c2fe543fa611ae3159ee688db69d7402ee97..55c280984b18975e610db64970923ebc6487e14d 100644 (file)
@@ -13,7 +13,9 @@ If using Debian unstable or testing:
 
 Or download the deb from <http://packages.debian.org/unstable/web/ikiwiki>.
 
-While this deb has been developed on Debian unstable, it should also work on stable, although to get the CGI stuff working on stable, you will need to upgrade to a newer version of libcgi-formbuilder-perl, `3.02.02`.
+While this deb has been developed on Debian unstable, it should also work
+on stable, although to get the CGI stuff working on stable, you will need
+to upgrade to a newer version of libcgi-formbuilder-perl, `3.02.02`.
 
 # subversion
 
index de04dcdd533a6a38a4021ef6721d403c3d8f5421..de16a917920cc231f6b77b05b0ed87a3c7d38691 100644 (file)
@@ -28,6 +28,10 @@ You can use any field names you like, but here are some predefined ones:
   Overrides the title of the page, which is generally the same as the
   page name.
 
+  Note that if the title is overrideen, a "title_overridden" variable will
+  be set to a true value in the template; this can be used to format things
+  differently in this case.
+
 * license
 
   Specifies a copyright license for the page, for example, "GPL".
index 6d90543895f95baa393b312bc31d4a5bf91adcdc..950c4f1f9f5046a8c09911eb12a6b5b585518e64 100644 (file)
@@ -116,13 +116,7 @@ used to generate the page. The function can manipulate that template
 object.
 
 The most common thing to do is probably to call $template->param() to add
-a new custom parameter to the template. Note that in order to be robust,
-it's a good idea to check whether the template has a variable before trying
-to set it, as setting a variable that's not present is an error.
-
-       if ($template->query(name => 'foo')) {
-               $template->param("foo" => "bar");
-       }
+a new custom parameter to the template.
 
 ## sanitize