-
Notifications
You must be signed in to change notification settings - Fork 0
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
Prompting twice when using templater plug-in #10
Comments
Rather surprising, to be honest. Using now folder template but template in my plugin, I don't repro the bug. Maybe the template is triggered twice because of a conflict. |
I will try to communicate this the best way I can, hope this helps: Your Plugin: ], Templater: { Anything else that could be helpful? |
Pretty surprising. With the same settings, the template is not triggered twice and work as it should 🤔 |
Does it somehow make a difference that i trigger the new note via a hotkey? |
No, I test using the command from palette so it doesn't make any difference. |
Ok then I will have to test a bit further on my system, maybe somehow a different plugin causes it. |
No worry! If you found something, tell me ! |
I just recorded the bug as well, just to show you. |
Hmm, could you open the Dev console (CLTR + MAJ + I) to show if there are, by chance, any log ? |
I think my plugin is not in the cause here :/ |
I deactivated both Plugins. Then the console shows nothing of interest. Seems like this will remain a mistery 😆 |
@Lisandra-dev, I also have Templater triggering twice. In my case, this is because Create Note in Folder has a Templater template path set for a folder definition, and Templater itself has the "Trigger Templater on new file creation" option enabled, thus Templater triggers twice. For example, my template prompts me twice to enter the new notes file name. If Create Note in Folder could have an option to simply insert the template rather than trigger it, then I assume both options could remain enabled (Templater would trigger what New Note in Folder inserts)? It depends on the order of which plugin acts first I guess. The reason for keeping both options enabled is that I'd like to still be able to click the "Open today's daily note" button to trigger a Templater template, and this is only possible with its "Trigger Templater on new file creation" enabled I think. The Templater option also allows me to enable its Folder Templates option with Hopefully I explained that simply enough! |
I think it's too much complicated here… Templater don't have public API so I need to search each time for fix. |
Do you think this would work as a workaround @Lisandra-dev? A simple toggle to disable your plugin from triggering the Templater template -- only insert it (and let Templater trigger it by its "Trigger Templater on new file creation" option). Until there's a better solution, maybe a toggle like this is enough? |
You can litteraly use templater for a folder so I don't know why do you want to use my plugin instead? |
First of all what a great plugin, thank you so much, it works great!
I Just have a problem when using it in conjunction with the templater plugin. When i create a new note in a folder via your plugin it prompts all prompts from the template that im using twice. Any idea why this happens/ how to fix?
<%*
if (tp.file.title === "Untitled") {
const folder = await tp.system.prompt("Enter Customer name");
const title = await tp.system.prompt("Enter title");
if (folder && title) {
await tp.file.move(
Customer/${folder}/${title}
);} else {
// Handle the case where either folder or title is not provided.
await tp.file.move(
Meetings/${title}
);}
}
%>
Thanks and much love
The text was updated successfully, but these errors were encountered: