-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Please fill out these Check-boxes
- I checked for existing similar feature requests
- I have read the docs and checked that the feature I am requesting is not already implemented
- My feature request consists of only one feature
Is your Feature Request related to a Problem or Annoyance?
My real problem is that I want to have a button to add rows to a table following a template.
| Time | Note |
| ----- | ------------- |
| 10:00 | [[Breakfast]] |
| 13:25 | [[Meditate]] |
`BUTTON[add]`But the only way I have figured out to do this is to replace the button with a template that itself contains a copy of the button:
| <% tp.date.now("HH:mm") %> | |
```meta-bind-button
label: Add
style: default
id: add
actions:
- type: replaceSelf
replacement: "templater/Log Entry.md"
templater: true
```But now I have to maintain the two copies. I was frustrated to find out that this does not work with inline buttons that would make this an almost elegant solution.
I'm open to better solutions, but I still feel that inline button replacement would be nice.
Describe the Feature you'd like
Make Replace Self work with inline buttons so that the inline button is replaced.
Example
| Time | Note |
| ----- | ------------- |
| 10:00 | [[Breakfast]] |
| 13:25 | [[Meditate]] |
`BUTTON[add]`
```meta-bind-button
label: Add
style: default
id: add
hidden: true
actions:
- type: replaceSelf
replacement: "templater/Log Entry.md"
templater: true
```Template
| <% tp.date.now("HH:mm") %> | |
`BUTTON[add]`Alternatives
- Insert Into Note with line number wouldn't work because line number increases for each table row
- RegExp Replace In Note could be used to replace the button, but it does not seem to support templates
- Run JavaScript File could be used but would be tedious to figure out
- Run Templater File, likewise
Additional Context
This is mentioned in docs of Replace Self.
This only works with buttons in blocks, so this action will not work with inline buttons which are not inside a meta-bind block.
A bonus is that you would no longer need to document this limitation :-)