Inline buttons with dataviewjs

Hey there!

I am trying to create a ‘button template’ so I can reuse a button in multiple places using the inline button plugin. I have created the button using dataviewjs and calling the functions from the button plugin.

How can I get it to show up in the command pallette when I want to add an instance to it?

I have a feeling it is something to do with it looking for block-language-button in the div when it is actually block-language-dataviewjs

Things I have tried

  • adding the ^button-new-journal-entry underneath
  • passing the id as an arg:

See code below:

const { createButton } =["buttons"];
const year = moment("YYYY");
const month = moment("MMMM");
const fileName = moment("DD-MM-YY - dddd");

const clickHandler = async () => {
  const currentEntry =
  if (currentEntry) {
  } else {
    //check if the year and month folders exist, if not create them
      const yearDir = await
      if (!yearDir) {
      const monthDir = await
      if (!monthDir) {
    const newEntry = await

  el: this.container,
  args: { name: "📔 New Journal Entry", class: "custom-button" id: "button-new-journal-entry"},
  clickOverride: { click: clickHandler, params: [] },

I tried wrapping the div in a container with a div with the id of block-language-button and it was visible as new not the full id and it didn’t not work fully with the inline button prompt in the command palette