lumoe / obsidian-rollover-daily-todos

An obsidian plugin that rolls over todo items from the previous daily note
MIT License
264 stars 65 forks source link

Does not work well with the templater plugin #63

Closed lenalebt closed 1 year ago

lenalebt commented 1 year ago

I had some trouble using this plugin in combination with Templater. I tried using it with "trigger templater on new file creation". Templater wants to only work on empty files, and this seems to interfere with "rollover daily todos".

As a workaround, I recreated some of the functionality of "rollover daily todos" by copying a bit of code and making it available as a templater "user script", pasting the gist to make it possible for others to find a workaround in case they stumble upon this :-)

https://gist.github.com/lenalebt/8e58aa21392c388d8c7d65bad3206e35

expionage commented 1 year ago

Thank you @lenalebt! I had trouble getting this plugin to work, and noticed I also had Templater enabled. Tried your workaround and it worked perfectly.

One thing I did notice was that while the items did rollover, the todo checkboxes became more like an ASCII checkbox vs. an actionable one.

In other words, I couldn't just click on it anymore to complete a todo. (see first checkbox.)

rollover-todo-checkboxes-nonactionable

lenalebt commented 1 year ago

Oh, that's interesting - I don't have that problem. I noticed that your tasks end up in a code box (three back ticks). I think that's where the non-clickable boxes come from.

If you have further questions, feel free to directly comment on the gist - then we can leave this ticket related to things about the plugin :slightly_smiling_face: . It might help if you post your templater source to the gist, then I'll help you work this out over there!

lumoe commented 1 year ago

Thank you for your input and contribution @lenalebt. If more people are affected by this, please feel free to submit a PR to the README file in the Bugs/Issues section, where we can redirect people to your solution.

TrustTepee commented 1 year ago

I've been having the same issue. It seems to be an incompatibility with templater's "Trigger Templater on new file creation" setting. If I turn off that setting, everything seems to work fine. It seems both plugins are simultaneously trying to write to the file and Templater ends up erasing the Todos

oscarlevin commented 1 year ago

I too found this issue after having trouble with this: I have templater create my daily notes (in a couple of stages, i.e., templates inside templates) and it overwrites the rolled over todos.

I know next to nothing about how these plugins work, but would it be possible/easy to build in a very slight delay (0.5 seconds) before the rollover happens?

ironman820 commented 1 year ago

I am throwing my experience/2 cents in. I've been using the Periodic Notes community plugin before adding Rollover Todos. I enabled "Trigger Templater on new file creation" and set the template up in the Periodic notes plugin; removing it from the Templater "Folder Templates" section. This way, the periodic notes plugin creates the file with the Templater template in place, Templater is then working with an existing file with its tags already inline and the Rollover Todos plugin adds its lines to the heading it needs to. I've only been using this setup for a few days, so I don't have enough experience to say this will work every time, but so-far-so-good. I am adding screenshots of Templater and Periodic Notes settings as an example.

Templater-settings

Periodic-Notes-settings

lumoe commented 1 year ago

Hi there,

I've just pushed a new release that introduces the option to disable the automatic rollover when creating the daily file.

For those utilizing the Templater plugin, ensure you turn off the automatic rollover feature within the Daily Rollover Settings tab. You can then manually roll over the to-dos via the provided command.

Currently, this approach ensures optimal compatibility and avoids potential conflicts with the Templater plugin.

AmmarCodes commented 9 months ago

For reference, I was able to fix this using templater by adding this at the end of the daily note template:

<%* app.commands.executeCommandById('obsidian-rollover-daily-todos:obsidian-rollover-daily-todos-rollover') %>