Keep raw querry on new page from template

Hi all,

I’m trying to insert some raw querries/live template in new pages. However, I could not find a proper solution.

On my first try, simply putting the querry in the template led to the querry result being baked in on document creation.

I then tried to insert the querry as an external snippet using {{template([[Library/Personal/TestTemplate]])}}. It completely break the template, selecting it for a new page doesn’t work.

While looking for a solution I found this post. Using {{[[Library/Personal/TestTemplate]]}} does work but with the side effect of also including the frontmatter on the created page.

I currently settled for this last solution. However, I would like to be able to tag my snippet. Mostly so it doesn’t appear in the page picker. Any idea how I can achieve my goal?

I feel like it would be nice to have a way to mark text that should remain unprocessed when a template gets instantiated.

I just found the solution to keep querry/template block in the new document instead of evaluating the content of the querry on creation.

The solution is to use the escapeDirective function.

The following in a template:

```template
{{escapeDirective("template([[Template/Path]])")}}
```

Will be rendered as follow in new pages:

```template
{{template([[Template/Path]])}}
```

This is cool! I was trying to find this kind of solution but then I switch to use rather the page front/bottom hook.