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

Folder Template overwrites non-empty note #1406

Open
Smitty010 opened this issue Jun 26, 2024 · 2 comments
Open

Folder Template overwrites non-empty note #1406

Smitty010 opened this issue Jun 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Smitty010
Copy link

Plugin information (please complete the following information):

  • OS: Windows 11 latest
  • Templater version: 2.3.3 (latest)
  • Obsidian version: 1.6.5 (latest)
  • Templater settings: I have a folder template setup to active when a new note is created in my default notes folder
    image

Describe the bug

I use the Note Refactor Plugin to create a new note from a section of an existing note. I am using the command
image
. I can see visually what happens on the screen. The section of the existing note is copied to a new note which is created in the default notes folder. The content from the existing note appears for a few seconds in the new note and then I can see the that content being overwritten by the notes template specified in the folder template setup. This completely wipes out the data copied from the original note. I tried adding in <% tp.file.content %> to the notes template to get the content from the file, but it ends up empty.

Expected behavior
The folder templates section say that "folder templates are tiggered when a new empty file is created in a given folder" Since the refactored file is not empty, I would have expected that the folder template would not have been activated. If it was going to be activated, it would be nice if tp.file.content actually gave me the file content (then I could add that to the folder template and that content would be saved).

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
It feels like a timing issue where templater activates before the refactored file is populated and so doesn't notice that there is content.

@Smitty010 Smitty010 added the bug Something isn't working label Jun 26, 2024
@McGlear
Copy link

McGlear commented Jul 5, 2024

I assume this is basically a duplicate of #1394
Upon creation, the file probably is empty, then both plugins try to populate the same file ...

@Smitty010
Copy link
Author

I agree that’s a reasonable explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants