joplin / plugin-templates

Create templates in Joplin and use them to create new notes and todos.
MIT License
163 stars 23 forks source link

Templates which have note overview plugin code in them do not work #45

Open meldarionqeusse opened 3 years ago

meldarionqeusse commented 3 years ago

I tried creating a template which has a note overview (from note overview plugin) to get summary of tasks I have not completed. If you look at the code below the noteview in the template has {{notebook}} {{title}}, {{tags}} etc these get removed when I create note from template

This is the template:

---
project: dropdown(Work, Personal)
template_title: {{ subproject }} 
name: text
template_tags: {{#custom_datetime}}YYYY{{/custom_datetime}}, {{#custom_datetime}}MMMM{{/custom_datetime}},{{ project }} 

---

## {{ template_title }} - {{  name  }}

This note contains the meeting minutes of the weekly meet held on {{ datetime }} for {{ project }}.

<!-- note-overview-plugin
search: notebook:"My Notes" type:todo iscompleted:0
fields: title,body
alias: updated_time AS Last Updated, title AS Title
listview:
  text: "{{  notebook  }} > {{  title  }} {{  tags  }} <details> \r

    \ {{  body  }} \r

    \ </details>"
  separator: "<hr>\r\n"
-->

This is how it transforms when I create a note from template

 Test

This note contains the meeting minutes of the weekly meet held on 24/09/2021 10:47 for Work.

<!-- note-overview-plugin
search: notebook:"My Notes" type:todo iscompleted:0
fields: title,body
alias: updated_time AS Last Updated, title AS Title
listview:
  text: " >   <details> \r

    \  \r

    \ </details>"
  separator: "<hr>\r\n"
-->
nishantwrp commented 3 years ago

Yup, this is expected because the text of form {{ something }} is considered as variable by this plugin. But I'll explore if there's a way to allow users to use these braces as normal text.

jbsauvan commented 2 years ago

Hello, I ran into the same issue and found two possible workarounds. Here they are in case someone can find this useful.

Solution 1: Defining text with template custom variable

Solution 2: Escaping double curly brackets and defining note-overview-plugin as template custom variable