Update namespace queries when renaming the page they draw from

Suppose we have two pages: ParentPage and ParentPage/ChildPage. If I now now want to use a namespace in ParentPage to render the hierarch, I can easily do it using:

{{namespace [[ParentPage]] }}

The problem occurs if I now decide to rename ParentPage to ParentPage2. My namespace query will now stop working because it won’t catch that change.


What I am proposing is some sort of an empty namespace query, which will always assume that it means a reference to the title of the page the query is in. Thus

{{namespace }}

would dinamically render the hierarchy of the current page, regardless of its title.

Well, technically, you’re assigning the namespace to the page whose name matches ParentPage, so changing the page name doesn’t match the condition.

Therefore, the condition should refer to another attribute that is independent of the page name and uniquely identifies it. That is, the ID of the block it is a child of. Isn’t it?

I tried setting it to the ID of a namespace page, but it won’t render anything. And, even if that worked, I think it would be a serious mental stretch for a newcomer to Logseq. On the other hand, automating that same process by simply omitting an argument ({{namespace}}) seems straightforward.

I believe you can use the dynamic variable <% current page %> for this?