-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Notes are created in parent directory instead of specified directory #1332
Comments
You're setting the file name to an empty string, what are you expecting the file name to be when the file is created?
|
Yes sorry I should of mentioned that, I leave file name blank, then inside the journal_template there is a templater block that renames it to todays date. I've copied that in below. I'm not sure that's the issue, as it creates the new note with today's date fine, just at the wrong level in the directorys.
|
What should the file name be before your template renames it? That's where I'm a bit lost, I need to know what it was doing before. |
I don't currently set it, as it is immediately renamed. So I'm guessing it is either empty string or defaults to untitled. |
Yes I just tried it without the rename command in the template and it just gets set to untitled. |
…filename to `tp.file.create_new` refs: #1332
I was able to encounter the same issue using just Templater and <%*
const templateFile = tp.file.find_tfile("Templates/journal_template.md");
const folder = app.vault.getAbstractFileByPath("Work/Organiser/DB/Journal");
const fileName = "";
await tp.file.create_new(templateFile, fileName, true, folder);
-%> I have fixed this in 2.2.3, I believe this will also resolve the issue you were facing with metabind! |
Brilliant thank you 👍 |
Plugin information (please complete the following information):
Describe the bug
When using versions greater 2.1.4, when using templater to create a new note from within metabind it creates the note in the parent folder rather than the specified folder. For the example below, notes are created in the journal folder in version 2.1.4 and in the DB folder in versions 2.2.0 and above. I have tried adding an extra / to the end of path but get error folder not found.
Apologies if this is an issue with how metabind integrates with templater, i could just see changes in getting paths within templater recent releases. And downgrading to 2.1.4 fixes the issue.
Expected behavior
Notes to be created within the specified directory.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: