1 In my wiki I have a template page under `/templates` that looks like this:
4 pages="<TMPL_VAR PAGE>/* and !<TMPL_VAR PAGE>/*/*"
11 pages="<TMPL_VAR PAGE>/* and !<TMPL_VAR PAGE>/*/*"
14 I tested this page with many variations and by trial and error reached a conclusion that
15 when using `trailitems` with a path that contains TMPL_VAR, or using the inline directive
16 with `trail=yes` and a `pages` that contains TMPL_VAR, the trail plugin (or something else?)
17 seems to not resolve the TMPL_VAR and ikiwiki fails to compile the wiki, and I get this:
19 syntax error in pagespec "<TMPL_VAR PAGE>/* and !<TMPL_VAR PAGE>/*/*"
23 Until I get feedback here I'll try to look at the source and see if I figure it out.
24 My ikiwiki version: 3.20130904
26 Huge thanks in advance!
30 > These templates have traditionally had a problem: they need to be
31 > simultaneously a valid page in their own right, and a valid page after
32 > template substitutions.
34 > In newer ikiwiki versions, the [[ikiwiki/directive/templatebody]]
35 > directive [[solves this|done]] ... but your ikiwiki is nearly a year
36 > and a half old, so you don't have recent bugfixes.
38 > You might be able to get somewhere by abusing the two intersecting
39 > markup languages, something like this:
42 > \[[!if test="included() and !included()" then="""
44 > ... real content here: inline, trailitems etc. ...
45 > ... just don't use a triple quote mark ...
50 > Alternatively, if you have direct commit access and don't need
51 > to be able to perform web-based edits on your template, I think
52 > renaming your template from `foo.mdwn` to `foo.tmpl` would bypass
53 > this while still working as a template. --[[smcv]]