shabegom / buttons

Buttons in Obsidian
The Unlicense
478 stars 50 forks source link

Feature Request: New button type that can modify a metadata field #83

Closed tungleng closed 8 months ago

tungleng commented 2 years ago

Request: New button type that can modify a specified metadata field upon being clicked. Use Case:

shabegom commented 2 years ago

Just so I understand, you want to supply the metadata field inside the button itself and have that passed to a CustomJS function to update? I'm not sure why you wouldn't just call the CustomJS function from a Templater template note with the metadata field supplied there?

I can hook into the MetaEdit plugin if that's an ok approach.

tungleng commented 2 years ago

Just so I understand, you want to supply the metadata field inside the button itself and have that passed to a CustomJS function to update?

Yes, that is the intention.

I'm not sure why you wouldn't just call the CustomJS function from a Templater template note with the metadata field supplied there?

I can hook into the MetaEdit plugin if that's an ok approach.

My understanding of Templater is that it will always add new text to the current note, and using MetaEdit can avoid that.

shabegom commented 2 years ago

My understanding of Templater is that it will always add new text to the current note

Not necessarily. You can use it to run any arbitrary bit of javascript and not output anything. You use the <%* %> command format.

paulrudy commented 2 years ago

I'm following https://github.com/shabegom/buttons/issues/73 for this exact purpose.

Saorsa32 commented 2 years ago

Me too

xmacex commented 2 years ago

I am new to Obsidian and hoping to exit Evernote soon, and would like a button which marks the current note as "done". The workflow i am trying to reproduce "each note is a todo action" and having a button modify frontmatter would be great.

Anyway, interesting plugin, thanks for making it available. 🔘👈

DeutscheGabanna commented 2 years ago

I can hook into the MetaEdit plugin if that's an ok approach.

is the integration with metaedit completed now?

shabegom commented 2 years ago

I can hook into the MetaEdit plugin if that's an ok approach.

is the integration with metaedit completed now?

lol no. But MetaEdit does expose an api that you can use in a templater command.

I'm not sure I understand why running a templater block with no output is an issue?