obsidian-folder-notes icon indicating copy to clipboard operation
obsidian-folder-notes copied to clipboard

Duplicate entries per folder note

Open creativefibro opened this issue 1 year ago • 3 comments

I have added the template path to a template that has only this on it, bar a title.

TABLE  
FROM -#MOC  
WHERE contains(file.folder, this.file.folder)  

When I create a folder note it adds two sets of queries per page. As shown in the image. CleanShot 2024-07-16 at 10  01 11@2x

creativefibro avatar Jul 16 '24 21:07 creativefibro

I can't reproduce it. Do you maybe have something else enabled that also adds a template to it? Or can you reproduce it in a sandbox vault?

LostPaul avatar Jul 18 '24 09:07 LostPaul

I also have this issue. Kind of.

When using the "Settings > General > Key for creating folder note" (in my case "Alt + Click"), it works as expected.

However, when I set up a Hotkey for "Folder notes: Create markdown folder note for current folder of active note" (in my case "⌘ + Enter") and use the Hotkey, the template is duplicated in the created folder note.

n1ck3 avatar Aug 06 '24 12:08 n1ck3

Like @n1ck3, I have this bug. Using the "Alt + Click" method works fine, but if I right-click on a folder and select "create markdown folder note", I get the contents of the templates file doubled.

oldjove avatar Aug 30 '24 11:08 oldjove

I can confirm the above with 1.7.32 on Obsidian 1.7.4.

If you use the hotkey command (for me Ctrl+Click), it creates fine. But if you use the right-click menu -> Folder Note Commands -> Create markdown note ... it duplicates everything after the Frontmatter fold (if your template has frontmatter in it).

I debugged it in a blank vault with a few plugins I suspected might be conflicting and narrowed it down to Templater. If that is installed, it seems Templater takes over the templates path and things get executed twice.

Disabling Templater, you can't set a file directly in Folder Notes path setting so you have to manually edit the data.json with Obsidian closed, it works fine after that .. until Templater is started again.

The fix seems to be to add a blank Templater command in the Folder Note template (I put it directly below the Frontmatter delimiters).

<%""%>

And it appears to work fine after that.

kylek29 avatar Oct 31 '24 19:10 kylek29

Will be fixed soon see #187

LostPaul avatar Feb 04 '25 20:02 LostPaul