From: http://jmtd.livejournal.com/ Date: Mon, 15 Nov 2010 14:43:35 +0000 (+0000) Subject: not quite done yet: if/included() doesn't work that way. X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=commitdiff_plain;h=5430d5dc3bc37df92eb01cd65382c0f2be78b8e7;hp=62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14 not quite done yet: if/included() doesn't work that way. --- diff --git a/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn b/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn index 5485bba9c..83093895b 100644 --- a/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn +++ b/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn @@ -46,8 +46,7 @@ A workaround is to move the template outside of the srcdir into the external tem \[[!template id=all_entry.tmpl year=2010 current=true]] -An alternative fix is to wrap the entire template inside a test to see whether the page is included or not. E.g. - +I believed (until I tested) that the [[ikiwiki/directive/if]] directive, with the `included()` test, would be an option here, E.g. \[[!if test="included()" then=""" ...template... @@ -55,6 +54,4 @@ An alternative fix is to wrap the entire template inside a test to see whether t Nothing to see here. """]] -In fact, this is probably best practice for in-srcdir templates. I'd consider this done if the documentation for the directive suggested it. -- [[Jon]] - -> [[done]] with -- [[Jon]] +However this doesn't work. I assume "included" in this context means e.g. via an `inline` or `map`, not template trans-clusion. -- [[Jon]]