Skip to content

Feature: run templater code if button type is not set#300

Open
eugritz wants to merge 1 commit into
shabegom:mainfrom
eugritz:feature/execute-templater-action
Open

Feature: run templater code if button type is not set#300
eugritz wants to merge 1 commit into
shabegom:mainfrom
eugritz:feature/execute-templater-action

Conversation

@eugritz

@eugritz eugritz commented Jun 7, 2026

Copy link
Copy Markdown

When user creates a button using Button Maker and chooses button type "Template", user has to choose the template note and an action. The default option for action is "Do this...". I presume it's supposed to mean an unselected value that does nothing, and it acts exactly this way.
However, in case of more complex operations, such as updating different parts of note, template notes can operate with current note without returning a value, so it should be possible to execute a template note without returning a value. As of now, this is not possible, and any attempts to do this interfere with buttons plugin.

The recently introduced feature replace doesn't help either, because it replaces contents of the file before executing the template, so it's impossible to get previous contents of the file.

This PR changes the behavior of buttons: if action is not set, it executes the template without interfering with any changes introduced to current note.

@netlify

netlify Bot commented Jun 7, 2026

Copy link
Copy Markdown

Deploy Preview for buttons-docs canceled.

Name Link
🔨 Latest commit 43b9b69
🔍 Latest deploy log https://app.netlify.com/projects/buttons-docs/deploys/6a252f5a0284d90008903f20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant