Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
meldarionqeusse opened this issue Sep 24, 2021 · 2 comments

Comments

@meldarionqeusse
Copy link

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"
-->
@meldarionqeusse meldarionqeusse changed the title Templates which have note overview Templates which have note overview plugin code in them do not work Sep 24, 2021
@nishantwrp
Copy link
Collaborator

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.

@nishantwrp nishantwrp assigned nishantwrp and unassigned nishantwrp Dec 4, 2021
@jbsauvan
Copy link

jbsauvan commented Jul 3, 2022

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

  • Define a template custom variable as a dropdown variable
    • e.g.: note_text: dropdown({{title}} ({{created_time}}))
    • By using a dropdown variable with a single choice it is filled automatically when creating a new note from template
  • In the note-overview section, use the variable defined above
listview:
  text: "{{note_text}}"

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

  • Similar principle as the first solution, but applied differently
  • Define a dropdown variable note_overview: dropdown(note-overview-plugin)
  • Define the note-overview section with <!-- {{note_overview}} instead of the standard <!-- note-overview-plugin
  • Escape {{}} in the note-overview section using \{{}}:
listview:
  text: "\{{title}} (\{{created_time}})"

@nishantwrp nishantwrp self-assigned this Nov 4, 2023
@nishantwrp nishantwrp removed their assignment Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants