README file from
GithubObsidian Bases Buttons Plugin
This is a plugin for Obsidian that lets you define button properties, such as button.run, which render as clickable buttons in core Bases tables.
Each button runs a configured Templater template against the note represented by the property or Base row.
Requirements
- Obsidian 1.8.0 or later.
- The community Templater plugin must be installed and enabled.
Features
- Global button configuration: Define a button property, visible label, and Templater file path in one place.
- Template file suggestions: Start typing a template path in settings and choose from matching Markdown files.
- Obsidian Bases support: Injects buttons into matching Bases table cells only.
- Keyboard support: Press Enter on a selected button cell to run the button.
- Mobile confirmation: Optionally confirm before running buttons on mobile, enabled by default.
- Row-aware execution: Buttons clicked from a Base target the note in that Base row, even when that note is not open.
- Templater integration: Runs the configured Templater file through Templater's file-writing API so templates can update frontmatter or append content to the target note.
How to use
- Install and enable the Templater community plugin.
- Enable this plugin in your Obsidian vault.
- Go to Settings > Bases Buttons.
- Keep Confirm on mobile enabled if you want a confirmation dialog before mobile button runs.
- Click Add button.
- Enter a property name, for example
run; the plugin will usebutton.run. - Enter the button label to show in Bases.
- Start typing the Templater file path and select a template from the suggestions, for example
Templates/Archive task.md. - Add
button.runas a property column in a Base.
The plugin does not render buttons in note frontmatter. It only renders buttons inside Bases tables.
When clicked, tapped, or activated with Enter from a selected button cell, the button runs the configured Templater file against the note for that Base row. In templates, prefer tp.config.target_file when you need the note that was clicked from a Base. The active file may be the Base itself or another open note.
Example Templater snippet:
<%*
await app.fileManager.processFrontMatter(tp.config.target_file, (frontmatter) => {
frontmatter.done = true;
frontmatter.completed = tp.date.now("YYYY-MM-DD");
});
%>
Manual installation
Since this plugin is not yet in the community directory, you can install it manually:
- Download the latest release from the Releases page on GitHub.
- Extract the archive into your vault's plugins folder:
<vault>/.obsidian/plugins/bases-buttons/.- Ensure the folder contains
main.js,manifest.json, andstyles.css.
- Ensure the folder contains
- Reload Obsidian.
- Go to Settings > Community plugins and turn off "Safe mode".
- Enable the "Bases Buttons" plugin.
Local development
If you want to build the plugin from source:
- Clone this repository into your plugins directory.
- Run
npm installto install dependencies. - Run
npm run devto start compilation in watch mode, ornpm run buildfor a production build.
Compatibility
This plugin manipulates the DOM of Bases views, so it may require updates if the Obsidian core UI changes significantly in future versions.
Credits
This plugin is based on the original Custom Selectors plugin by hodie.
License
This project is provided under the MIT License.