pot files maybe..
[ikiwiki] / doc / todo / multiple_template_directories.mdwn
1 It would be nice to be able to override a single template without keeping a 
2 private copy of the entire template directory. 
3
4 a setup option like
5
6    templatedirs => [ "my/dir", "/usr/share/ikiwiki/templates" ] 
7
8 ought to do the trick.
9
10 > Now that I look at the source, I see that ikiwiki already falls back to the 
11 > global dir when it cannot find a template. For me, this is good enough.
12 > And it is even documented in the man page. Sigh. I guess this could be 
13 > considered [[done]].  
14
15 I have a use case for this, a site composed of blogs and wikis, templates divided in three categories : common, blog and wiki. The only solution I found is maintaining hard links, being able to have multiple template dirs would obviously be better. -- Changaco
16
17 > [[plugins/underlay]] used to allow adding extra templatedirs, but Joey
18 > removed that functionality when he made templates search the wiki's
19 > own `templates` directory.
20 >
21 > You can get a 3-level hierarchy like this:
22 >
23 > * instance-specific overrides: $srcdir/templates
24 > * common to the entire site: a directory that is the value of all
25 >   instances' `templatedir` parameters
26 > * common to every ikiwiki in the world: /usr/share/ikiwiki/templates
27 >   (implicitly searched)
28 >
29 > (by "instance" I mean an instance of ikiwiki - a .setup file, basically.)
30 >
31 > For a more complex hierarchy you'd need the old [[plugins/underlay]]
32 > functionality, i.e. you'd need to (ask Joey to) revert the patch that
33 > removed it. For instance, if anyone has a hierarchy like this, then
34 > they need the old functionality back in order to split the template
35 > search path for the things marked `(???)`:
36 >
37 >     every ikiwiki in the world (/usr/share/ikiwiki/templates)
38 >     \--- your site (???)
39 >         \--- your blogs (???)
40 >              \--- travel blog ($srcdir/templates)
41 >              \--- code blog ($srcdir/templates)
42 >         \--- your wikis (???)
43 >              \--- travel wiki ($srcdir/templates)
44 >              \--- code wiki ($srcdir/templates)
45 >
46 > This looks pretty hypothetical to me, though...
47 > --[[smcv]]
48
49 >> The reason I removed it is because the same functionality of having
50 >> multiple template directories is still present. Just put them in 
51 >> the templates/ subdirectory of multiple underlay directories instead.
52 >> --[[Joey]]
53
54 >>>Thanks, I didn't realize this was possible. Problem solved. -- Changaco
55
56 >>>> We can consider this [[done]], then. For reference, the solution
57 >>>> to the hierarchy I mentioned above would be:
58 >>>>
59 >>>>     all your sites have $your_underlay as an underlay
60 >>>>
61 >>>>     the blogs and wikis all have $blog_underlay or $wiki_underlay
62 >>>>     (as appropriate) as a higher priority underlay
63 >>>>
64 >>>>     every ikiwiki in the world (/usr/share/ikiwiki/templates)
65 >>>>     \--- your site ($your_underlay/templates, or templatedir)
66 >>>>         \--- your blogs ($blog_underlay/templates)
67 >>>>              \--- travel blog ($srcdir/templates)
68 >>>>              \--- code blog ($srcdir/templates)
69 >>>>         \--- your wikis ($wiki_underlay/templates)
70 >>>>              \--- travel wiki ($srcdir/templates)
71 >>>>              \--- code wiki ($srcdir/templates)
72 >>>>
73 >>>> --[[smcv]]