]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/no_easy_way_to_wrap_HTML_container_around_a_set_of_inlined_pages.mdwn
update
[ikiwiki.git] / doc / bugs / no_easy_way_to_wrap_HTML_container_around_a_set_of_inlined_pages.mdwn
1 The [[ikiwiki/directive/inline]] directive applies a template to each page-to-be-inlined, but the loop over the pages is in the Perl, not the template itself.  This means if I want to wrap a container `<div>` or a `<table>` or whatever around the entire set of inlined pages, I can't do it by just editing the template.  In fact, I think the only way to do it without hacking any Perl is with a wrapper template directive, e.g.
2
3     \[[!template id="wrapinline" pages="..."]]
4
5 with a template definition like
6
7     <div id="foo">\[[!inline ... pages="<TMPL_VAR raw_pages>"]]</div>
8
9 It would be much more convenient if the loop over pages happened in the template, allowing me to just stick whatever markup I want around the loop.
10
11 > Unfortunatly, I don't think this can be changed at this point,
12 > it would probably break a lot of stuff that relies on the current
13 > template arrangement, both in ikiwiki's internals and in
14 > people's own, customised inline templates. (Also, I have some plans
15 > to allow a single inline to use different templates for different
16 > sorts of pages, which would rely on the current one template per
17 > page approach to work.)
18
19 > But there is a simple workaround.. the first template in
20 > an inline has FIRST set, and the last one has LAST set.
21 > So you can use that to emit your div or table top and bottom.
22
23 > [[done]] --[[Joey]]