From 27a80dc40aa4cad93576a35d0af1f6c117ffcb68 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 7 Jan 2011 09:29:13 +0100 Subject: [PATCH] inline: allow assigning an id to postform/feedlink This allows per-form/feedlink group customization without having to resort to counting. (cherry picked from commit b134feb0dc2d9a8ff7ae447537fa8bc02811aabd) --- IkiWiki/Plugin/inline.pm | 7 +++++++ doc/ikiwiki/directive/inline.mdwn | 3 +++ templates/blogpost.tmpl | 2 +- templates/feedlink.tmpl | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 44e38436c..ffdf397f1 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -329,6 +329,10 @@ sub preprocess_inline (@) { $formtemplate->param(postformtext => gettext("Add a new post titled:")); } + if (exists $params{id}) { + $formtemplate->param(postformid => + $params{id}); + } $ret.=$formtemplate->output; # The post form includes the feed buttons, so @@ -346,6 +350,9 @@ sub preprocess_inline (@) { $linktemplate->param(atomurl => $atomurl); $linktemplate->param(atomdesc => $atomdesc); } + if (exists $params{id}) { + $linktemplate->param(id => $params{id}); + } $ret.=$linktemplate->output; } diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn index 49b993d55..22c18d9a1 100644 --- a/doc/ikiwiki/directive/inline.mdwn +++ b/doc/ikiwiki/directive/inline.mdwn @@ -75,6 +75,9 @@ Here are some less often needed parameters: disable generating any feeds. * `emptyfeeds` - Set to "no" to disable generation of empty feeds. Has no effect if `rootpage` or `postform` is set. +* `id` - Set to specify the value of the HTML `id` attribute for the + feed links or the post form. Useful if you have multiple forms in the + same page. * `template` - Specifies the template to fill out to display each inlined page. By default the `inlinepage` template is used, while the `archivepage` template is used for archives. Set this parameter to diff --git a/templates/blogpost.tmpl b/templates/blogpost.tmpl index b9a3bc666..9e49c474a 100644 --- a/templates/blogpost.tmpl +++ b/templates/blogpost.tmpl @@ -1,4 +1,4 @@ -
+id="" action="" method="get">
RSS diff --git a/templates/feedlink.tmpl b/templates/feedlink.tmpl index 392871e03..c67ad9c2b 100644 --- a/templates/feedlink.tmpl +++ b/templates/feedlink.tmpl @@ -1,4 +1,4 @@ -