I want query the page whose property value is the current page title and try to display other properties in table view.
Can anyone tell me how to query a page by its property value?
I’ve made some attempts and they were all poorly done:
Can anyone tell me how to query a page by its property value?
{{query (property dummyproperty "this is a value")}}
query the page whose property value is the current page title
As far as I can see, this is possible when you simply use the name of the current page. The dynamic variable <% current page %> normally works in queries, but not when the page name contains spaces. Wrapping it in quotes does not work either. I am guessing this prevents it from being expanded.
So to be clear the following does not work:
{{query (property dummyproperty "<% current page %>")}}
{{query (property dummyproperty <% current page %>)}}
I tried to work around this by making the not-working-examples above into a template. Unfortunately, this also doesn’t work as the dynamic variable gets expanded like this [[page title]]. The brackets prevent it from working.
Trying to do something similar and display it as a table along with other page properties. Querying for page-tags works fine, but querying property key value returns a list of blocks and not specifically pages that have that key value.
Yes, page-tags works well. Now I just use tags:: instead of customized page property name.
Here is query code I am using, I guess there may be some way to replace ?tag with users’ property name.