Zim

Where can I learn more about the template language

Asked by Svenn

I finally got tired of typing the same text over and over again when creating new pages, and wanted to modify the template a bit. In the help there is not much description of the evaluation language used. Where can I find more info on the syntax of this language? What I am looking for is:

if page.namespace == 'trackers:trac' or page.namespace == 'trackers:worlist'
   task template text
else
  normal page text
end

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
Jaap Karssenberg
Solved:
Last query:
Last reply:
Revision history for this message
Best Jaap Karssenberg (jaap.karssenberg) said :
#1

Did you check the user manual ? It has a page about templates. You can also
find it online here: http://www.zim-wiki.org/manual/Help/Templates.html

For this specific example you should note that the "IF" clause does not
support the "OR" expression, just test for equality with "==". So you need
two separate "IF" clauses to achieve the same result.

Revision history for this message
Svenn (svenn-bjerkem) said :
#2

First off all, I had to place my template in Default.txt for it to be used. Documentation says _New.
The Calendar.txt uses some ELSIF and -%] [%- things which I also do not find in the documentation.
This made me thing that the template documentation may not be quite up to date with latest version of zim

Revision history for this message
Svenn (svenn-bjerkem) said :
#3

Thanks Jaap Karssenberg, that solved my question.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#4

On Wed, Oct 19, 2011 at 3:15 PM, Svenn <<email address hidden>
> wrote:

> First off all, I had to place my template in Default.txt for it to be used.
> Documentation says _New.
> The Calendar.txt uses some ELSIF and -%] [%- things which I also do not
> find in the documentation.
> This made me thing that the template documentation may not be quite up to
> date with latest version of zim
>
>
>
Not unlikely I forgot to update the docs with last round of updates. Will
check.

-- Jaap