shabegom / buttons

Buttons in Obsidian
The Unlicense
478 stars 50 forks source link

Add template directly below button #7

Closed dpthomas87 closed 3 years ago

dpthomas87 commented 3 years ago

Hello,

Thanks for creating this awesome plugin. I'm wondering if there's some way to have a button that adds a template directly below it. I have a number of notes for 'meetings' with different people, and like to have the most recent meeting at the top of the pile. It would be great to have a button at the very top to be able to quickly add the next blank meeting template, but if it appears above the button, I then have to move the button up again or it'll get lost, which is more work than hitting ctrl+t and adding the template from there. If it's not a tricky feature to add, I would be able to use it in many places in my vault. Otherwise, I'm already getting value from your awesome plugin in other ways.

Thanks again for your time and have a great day!

shabegom commented 3 years ago

Append is supposed to be appending directly below the button. It's a bug! I'll investigate.

dpthomas87 commented 3 years ago

No problem mate. Apologies if it's user error. I tried it earlier today and it was adding the template to the bottom of the (very long) note rather than directly below the button. Totally possible that it's something I was doing wrong though. Thanks again for the great plugin.

dpthomas87 commented 3 years ago

Not sure how useful it is but here's a video of what's happening: https://user-images.githubusercontent.com/82196950/114184397-1f05ae00-9988-11eb-8415-fd9d671a25fd.mp4 Cheers!

shabegom commented 3 years ago

@dpthomas87 I'm having trouble recreating this issue! I've replicated the note and template from your video but the template file is appending below the button as expected. Could you help me troubleshoot:

  1. Make sure your on the most recent release of Buttons and see if it is still an issue
  2. Provide the markdown of your template and the note with the button
  3. To see if it is a problem with that specific template, try appending a different template into a different note.

I noticed it is also adding null to the top this makes me think it isn't finding the button in the note for some reason. Try renaming the button to a single word and see if the behaviour changes. Append basically finds the button based on its name and puts the template below the button. It looks like it can't find the button and then just dumps everything at the bottom of the note.

Hopefully with this we can track down the exact issue and I can squash that bug!

dpthomas87 commented 3 years ago

Hi mate, I've had a play and the plugin seems to be working fine now. One thing that might be worth mentioning: I had the Outliner plugin turned on today and it prevented Buttons from working at all. I even copied your example of toggling pins in a note from your description and it wouldn't work. When I turned off Outliner, buttons worked perfectly again. Anyway, thanks for looking into this and all the best as you keep improving the plugin.

shabegom commented 3 years ago

Hmm that's weird. I'm using Buttons and Outliner and it seems to be working.

Make sure both are updated to the latest version. If it still isn't working please open a new issue with some details.

image