buttons icon indicating copy to clipboard operation
buttons copied to clipboard

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

Open tungleng opened this issue 2 years ago • 8 comments

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

  • Together with the CustomJS plugin, we can have functions that takes metadata field as input parameter
  • These Javascript functions can, e.g., change the query on a Dataview based on said input
  • Hence, allowing for some dynamic interactions

tungleng avatar Nov 22 '21 21:11 tungleng

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.

shabegom avatar Nov 29 '21 14:11 shabegom

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.

tungleng avatar Nov 30 '21 20:11 tungleng

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.

shabegom avatar Dec 01 '21 00:12 shabegom

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

paulrudy avatar Dec 15 '21 07:12 paulrudy

Me too

Saorsa32 avatar Jan 07 '22 19:01 Saorsa32

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. 🔘👈

xmacex avatar Jan 30 '22 21:01 xmacex

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

is the integration with metaedit completed now?

DeutscheGabanna avatar Jul 09 '22 21:07 DeutscheGabanna

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?

shabegom avatar Sep 02 '22 00:09 shabegom