seethroughdev / obsidian-recipe-grabber

MIT License
53 stars 7 forks source link

Templater Conflict #35

Open emaginsf opened 3 months ago

emaginsf commented 3 months ago

Hi, I figured somethign out. I was having trouble with RG on all recipies. So I disabled all plugins, and figured out there's something in Templater that conflicts. I am using a custom Template within the RG plugin. Without Templater, it works like a charm. Not sure how to test further, any ideas?

seethroughdev commented 3 months ago

Thanks for posting this @emaginsf. I'm not aware of any way to control the order of community plugins, but I would imagine that's likely the issue here.

Appreciate the debugging and posting, hopefully it will help someone else searching for the issue too.

I am going to leave this open and try and give it some more thought. Maybe some of the more experienced obsidian devs have a better perspective as well.

emaginsf commented 3 months ago

Ok, further details for you:

TEMPLATER SETTINGS: Trigger on new file creation - YES Enable Folder Templates - YES Add New: Food | Reference/Templates/Recipe.md

RG SETTINGS: RG is set to save Recipies in /Food This is the same folder that Templater auto-applies the Recipe template anytime a new note lands in /Food.

Maybe that's something to warn people about?

seethroughdev commented 3 months ago

Thanks, will post an update in the README in the next release!

deafmute1 commented 1 week ago

If anyone is looking for a workaround to be able to use templater and grabber on the same folder, I made this "unifying" templater template. Instead of accessing recipe grabber via its own commands, you trigger this template (either via the modal or folder templates). Requires save in currently open file = True in recipe grabber settings. Only drawback is that recipe grabber can no longer set the title.

<%* 
const fname = await tp.system.prompt("Recipe Name")
const folder = <<YOUR FOLDER OR A MODAL PROMPT>>
await tp.file.move(folder + "/" + fname)
const useGrabber = await tp.system.suggester(["Grab Recipe", "Empty Template"], [true, false], true, "Use Recipe Grabber?")
if (useGrabber) { app.commands.executeCommandById('recipe-grabber:cmd-open-modal') }
-%>
<%* if (!useGrabber) { -%>
<<ADD YOUR TEMPLATE HERE>>
<%* } %>