shabegom / buttons

Buttons in Obsidian
The Unlicense
478 stars 50 forks source link

Template Button Does Not Recognize Templater Plugin #12

Closed acrose99 closed 3 years ago

acrose99 commented 3 years ago

Heyo, thanks for the awesome plugin but I'm running into a problem where the plugin doesn't recognize Templater.

Every time I use a template action I get the alert "You need to have the Templates plugin enabled". I have specified templates folder, and the templates plugin works fine.

Screenshots proving the above

New Screenshot 2021-04-24 at 11 06 25 AM New Screenshot 2021-04-24 at 11 06 46 AM New Screenshot 2021-04-24 at 11 06 50 AM

THIS MAY BE AN ISSUE WITH THE APP AND NOT THE PLUGIN

The issue may occur here:

const template = async (app, { name, type, action }) => {
    console.log("template button");
    const templatesEnabled = app.internalPlugins.plugins.templates.enabled;
    // only run if templates plugin is enabled
    if (templatesEnabled) {
    /* nothing runs because templatesEnabled = false  */

   else {
        new obsidian.Notice("You need to have the Templates plugin enabled",    2000);
    }
}

However, I checked app.internalPlugins.plugins and it seems to be screwed up. I've attached screenshots to show what I mean.

Proof Plugin is installed

New Screenshot 2021-04-24 at 10 46 31 AM

Proof Templates is not enabled.

New Screenshot 2021-04-24 at 10 47 15 AM
acrose99 commented 3 years ago

Also I am using a MacBook Pro (15-inch, 2019) on Catalina

shabegom commented 3 years ago

@acrose99 do you have the Templates plugin enabled? This is in Core Plugins. Then you specify the template folder in the core Templates plugin, not Templater.

I'll see if I can find the folder in Templater settings, but I'm not sure I can read that field. Alternatively I could ask for the full path to the template...

shabegom commented 3 years ago

Ah yeah I can read that setting. I'll push an update to look there too

shabegom commented 3 years ago

Should be fixed in latest release

acrose99 commented 3 years ago

RE: https://github.com/shabegom/buttons/issues/12#issuecomment-826117905

I'm an complete idiot and forgot that the template core plugin even existed, that fixed it. I'm really sorry for wasting your time.

shabegom commented 3 years ago

no worries! I updated it anyways so you no longer need to have it enabled if you're using Templater. 😅