I have “Note 1” of type A in which I have a button to create a new note, “Note 2” of type B. I use the Meta Bind and templater plug in for this.
The meta data of “Note 2” holds references to notes of type A.
When clicking on the button in “Note 1” I would like the new “Note 2” to automatically get a reference to Note 1.
Things I have tried
I tried adding the following to the template for note B
A-notes:
- "[[{{FromTitle}}]]"
Maybe it does not work with the button. It just become “{{FromTitle}}” as a link. I have also cosidered if I could pass the name when using the templaterCreateNote action of meta-bind plug in but could not find anything.
I did this a couple of days ago, using Templater and QuickAdd.
The Templater script here allows me to get the name of the “parent” file so I can rename the child note using the parent note’s name (with a prefix added).
The {{Linkcurrent}} is from QuickAdd, to create a link back to the parent.
Thank you for your input groberts56. Vey much appreciated! Based on your suggestion using QuickAdd I implemented solution below. It is less complicated and more secure.
Required plugins:
Templater
QuickAdd
Meta Bind
Steps:
Create the Template, B-file:
---
A-files:
- "{{LINKCURRENT}}"
---
In QuickAdd settings, create a new quickadd of type template. In my case I called it “createNote”.
In setting for “createNote” specify the template created in step 1.
Check the lightning bolt for “createNote” to make it available in the command pallet.
Create the Template, A-file shown below. The button is best done using the button builder in order to get the correct commandID.
Thanks for the feedback Simon4! I need to check out that meta-bind-button.
For my use case I simply created a hotkey after doing the command palette add, so I can create the child note and insert the link to it at the cursor location.