Can I add a button to add text directly above the button? I keep a running log in my daily notes. Currently use a template but a button at the bottom of the log would be even easier.
```button
name Add Log
type prepend template
action Log Template
```
One tricky bit is that buttons show in preview but you want to be in edit to write in the log. You can use Templater to switch into edit mode and put the cursor at the log entry point.
The button works great, but you make a good point about usability while in edit/preview mode. I’m rarely in preview mode, so this may be more of a learning exercise than anything.
I tried adding your code but only get an error. Template parsing error, aborting. Eta Error: Bad template syntax
And another 28 days later someone comes with an actual solution… @dylan_k and @dddave I had the same error which was for me because of copy pasting the code mentioned here which includes quotes that are not parsable by JavaScript. Also I got a “undefined” printed out after that fix. So for this to work correctly you would need to do something like this: