]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - doc/todo/allow_TMPL__95__LOOP_in_template_directives.mdwn
(no commit message)
[www/ikiwiki.git] / doc / todo / allow_TMPL__95__LOOP_in_template_directives.mdwn
index 1d324e2a616c01507d6cf1e18318675a89877c3e..6d0bd0971e79597a90609a527cdd0a3a211054c7 100644 (file)
@@ -1,4 +1,4 @@
-[[!tag patch]]
+[[!tag patch todo]]
 
 [[!template id="note" text="""
 Simply copied this from my website
@@ -6,10 +6,14 @@ Simply copied this from my website
 feel free to reformat / delete"""]]
 
 The following re-write allows for multiple definitions of the
-same tag value in a template definition.  This, in turn, allows
-us to use TMPL_LOOPS in our template directives; all-be-it in a
+same tag value in a [[plugins/template]] definition.  This, in turn, allows
+us to use TMPL_LOOPS in our [[ikiwiki/directive/template]] directives; all-be-it in a
 rather limited way.
 
+> I'm willing to consider such a feature, but it needs to be presented in
+> the form of a patch that is reviewable, not a gratuitous rewrite.
+> --[[Joey]] 
+
 I would, personally, only use this feature for very basic loops
 and, although nested loops *might* be possible (with a little
 more tinkering) it think any attempt would be better served by
@@ -27,6 +31,8 @@ head-aches.  Anyway it didn't make sense to post the patch since
 everything's changed now.
 """]]
 
+NB: this *should* be 100% backwards compatible.
+
 # `lib/perl5/IkiWiki/Plugin/template.pm`
 
 [[!format perl """
@@ -190,7 +196,7 @@ everything's changed now.
                my $page = $params{page}->[$#{$params{page}}] ;
                my $destpage = $params{destpage}->[$#{$params{destpage}}] ;
        # ... and an essential one for the production pass
-               $params{basename} = IkiWiki::basename($page) ;
+               $params{basename} = [ IkiWiki::basename($page) ] ;
 
        # load the template
                my $template ;
@@ -254,5 +260,5 @@ everything's changed now.
        data0="cell0:0"
        data1="cell0:1"
        data0="cell1:0"
-       data0="cell1:1"
+       data1="cell1:1"
        ]]