Simple queries using variables behave differently for page vs namespace

To make things simple, I’ll first display the queries to explain the problem:

Queries

Works:

{{query (and (task TODO LATER DOING NOW) (page <% current page %> ) ) }}

Doesn’t work:

{{query (and (task TODO LATER DOING NOW) (namespace <% current page %> ) ) }}

Works:

{{query (and (task TODO LATER DOING NOW) (namespace [[actual name of namespace]] ) ) }}

Filestructure

The file/document structure is as follows:

  • [[Main page]] (namespace)
  • [[Main page/subpage1]] page with tasks
  • [[Main page/subpage2]] page with tasks

Description

So the queries above, I’ve put in the document that is the namespace-document.
And for whatever reason, when using namespace <% variable %> doesn’t seem to work, but it works for page?
Is this intended behavior and I’m just missing something, or is it a bug?

1 Like