Zim

Page template functions disappeared in 0.62?

Asked by Rob Grace

Did the various template functions to access page metadata disappear in 0.61 or 0.62?
I had the following functions in 0.60 that could be used to list page metadata in both standard and journal pages (via mods to Default.txt and Journal.txt):

pageindex()
page.has_backlinks
page.backlinks
page.has_links
page.basename
page.namespace

I see several of these in the "export" template options, but I get Python errors if I try to use them as templates for page rendering:

This is zim 0.62
Platform: nt
Locale: en_US cp1252
FS encoding: mbcs
Python: (2, 7, 8, 'final', 0)
Gtk: (2, 24, 10)
Pygtk: (2, 24, 0)
Zim revision is:
  branch: 062
  revision: 739 <email address hidden>
  date: 2014-10-10 21:28:06 +0200

======= Traceback =======
  File "zim\gui\pageview.pyo", line 4879, in set_page
  File "zim\notebook.pyo", line 1981, in get_template
  File "zim\notebook.pyo", line 1994, in eval_new_page_template
  File "zim\templates\__init__.pyo", line 174, in process
  File "zim\signals.pyo", line 376, in emit
  File "zim\signals.pyo", line 224, in call_default
  File "zim\templates\__init__.pyo", line 178, in do_process
  File "zim\templates\processor.pyo", line 81, in process
  File "zim\templates\processor.pyo", line 128, in __call__
  File "zim\templates\processor.pyo", line 120, in __call__
  File "zim\templates\expression.pyo", line 205, in __call__
  File "zim\templates\expression.pyo", line 280, in __call__
AssertionError: Not a valid function: pageindex

Question information

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

The parameters that are available to templates have indeed changed in
version 0.61. THe full list of parameters that are available can be found
here: http://www.zim-wiki.org/manual/Help/Templates.html

On Mon, Nov 17, 2014 at 6:31 PM, Rob Grace <
<email address hidden>> wrote:

> New question #257767 on Zim:
> https://answers.launchpad.net/zim/+question/257767
>
> Did the various template functions to access page metadata disappear in
> 0.61 or 0.62?
> I had the following functions in 0.60 that could be used to list page
> metadata in both standard and journal pages (via mods to Default.txt and
> Journal.txt):
>
> pageindex()
> page.has_backlinks
> page.backlinks
> page.has_links
> page.basename
> page.namespace
>
> I see several of these in the "export" template options, but I get Python
> errors if I try to use them as templates for page rendering:
>
> This is zim 0.62
> Platform: nt
> Locale: en_US cp1252
> FS encoding: mbcs
> Python: (2, 7, 8, 'final', 0)
> Gtk: (2, 24, 10)
> Pygtk: (2, 24, 0)
> Zim revision is:
> branch: 062
> revision: 739 <email address hidden>
> date: 2014-10-10 21:28:06 +0200
>
> ======= Traceback =======
> File "zim\gui\pageview.pyo", line 4879, in set_page
> File "zim\notebook.pyo", line 1981, in get_template
> File "zim\notebook.pyo", line 1994, in eval_new_page_template
> File "zim\templates\__init__.pyo", line 174, in process
> File "zim\signals.pyo", line 376, in emit
> File "zim\signals.pyo", line 224, in call_default
> File "zim\templates\__init__.pyo", line 178, in do_process
> File "zim\templates\processor.pyo", line 81, in process
> File "zim\templates\processor.pyo", line 128, in __call__
> File "zim\templates\processor.pyo", line 120, in __call__
> File "zim\templates\expression.pyo", line 205, in __call__
> File "zim\templates\expression.pyo", line 280, in __call__
> AssertionError: Not a valid function: pageindex
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Can you help with this problem?

Provide an answer of your own, or ask Rob Grace for more information if necessary.

To post a message you must log in.