Skip to content

META BIND BUTTON BREAKS TEMPLATE WHEN LAUNCHED WITH A PREDEFINED VALUE #567

Closed
@timcrouse

Description

@timcrouse

Please fill out these Check-boxes

  • I checked for existing similar issues
  • I checked that the plugin is up to date
  • The issue persists with all other plugins and themes disabled

Plugin Version

1.4.1

This Issue Occurs on

  • Windows
  • Linux
  • macOS
  • Android
  • iOS

Debug Info

If I use a metabind radio button set to define a YAMLE parameter used to define a dataview query filter, the template malfunctions.  Once the template breaks, simply removing the metabind code does not clear the issue; I have to revert to the previous template to get things working again.   The template defines YAML properties at the top of the template code.  Without the Metabind code in the template, each of the YAMLs is created as expected when the template is used to create a new file based on the directory assignment.  When I add the meta bind code and run the template, many of the YAMLs are omitted, and only the last two are created.  Once this happens, the template is trashed, and simply using Ctrl+Z to go back a few steps does not clear the issue.


beginning of template code:

<%*
// RETRIVE USER DEFINED FILE NAME WHEN FILE IS BEING CREATED
// A NICE EFFECT OF CREATING A VARIABLE FOR THE FILE NAME IS THAT
// WE CAN GET ACCESS TO THE VARIABLE ANYWHERE IN THE NOTE.
const newFileName = await tp.system.prompt("Enter File Name: ");
// TEMPLATER CANNONT DIRECTLY EDIT YAML DATA.  AS SUCH TO GET A YAML
// PROPERTY OF "NAME" ESTABLISHED WE BUILD A NEW YAML FRONT MATTER AREA
// THIS GIVES US ACCESS TO THE NAME PROPERTY FOR DATA QUERIES
if (newFileName) {
tR += `---
NAME: ${newFileName}
COMPANY:
LOCATION:
PHONE:
EMAIL:
POC_ID_TAG:
ASSOC_PROJ_TAGS:
PROJ_STATUS_QUERY: ALL
---
`;
await tp.file.move("/01 - SUPPORT FILES/POCs/" + newFileName);
}
%>

METABIND RADIO BUTTON CODE BLOCK (I have tried not predefining a selection and have been attempting to enable a selection AND ensure the YAML param matches the selection, but neither works).

**PROJECT LIST QUERY FILTER**
-bind
INPUT[select(option(ALL), option(ACTIVE), option(COMPLETE)):PROJ_STATUS_QUERY]

Describe the Issue

If I use a metabind radio button set to define a YAMLE parameter used to define a dataview query filter, the template malfunctions. Once the template breaks, simply removing the metabind code does not clear the issue; I have to revert to the previous template to get things working again. The template defines YAML properties at the top of the template code. Without the Metabind code in the template, each of the YAMLs is created as expected when the template is used to create a new file based on the directory assignment. When I add the meta bind code and run the template, many of the YAMLs are omitted, and only the last two are created. Once this happens, the template is trashed, and simply using Ctrl+Z to go back a few steps does not clear the issue.

beginning of template code:

<%*
// RETRIVE USER DEFINED FILE NAME WHEN FILE IS BEING CREATED
// A NICE EFFECT OF CREATING A VARIABLE FOR THE FILE NAME IS THAT
// WE CAN GET ACCESS TO THE VARIABLE ANYWHERE IN THE NOTE.
const newFileName = await tp.system.prompt("Enter File Name: ");
// TEMPLATER CANNONT DIRECTLY EDIT YAML DATA. AS SUCH TO GET A YAML
// PROPERTY OF "NAME" ESTABLISHED WE BUILD A NEW YAML FRONT MATTER AREA
// THIS GIVES US ACCESS TO THE NAME PROPERTY FOR DATA QUERIES
if (newFileName) {
tR += `---
NAME: ${newFileName}
COMPANY:
LOCATION:
PHONE:
EMAIL:
POC_ID_TAG:
ASSOC_PROJ_TAGS:
PROJ_STATUS_QUERY: ALL

`;
await tp.file.move("/01 - SUPPORT FILES/POCs/" + newFileName);
}
%>

METABIND RADIO BUTTON CODE BLOCK (I have tried not predefining a selection and have been attempting to enable a selection AND ensure the YAML param matches the selection, but neither works).

PROJECT LIST QUERY FILTER

INPUT[select(option(ALL), option(ACTIVE), option(COMPLETE)):PROJ_STATUS_QUERY]

BROKE - TMP - POC.md
TMP - POC.md

TMP - POC.md

Steps to Reproduce

USING THE TEMPLATER PLUGIN: ASSIGN A TEMPLATE TO A DIRECTORY
ADD THE META BIND CODE TO THE TEMPLATE
CREATE A NEW FILE
NOTICE HOW MANY OF THE TAGS ARE NOT CREATED
REMOVE THE META BIND CODE
CREATE NEW FILE
TAGS ARE STILL NOT CREATED, ONLY THE LAST TWO GET CREATED.

IF THE METABIND CODE IS NOT ADDED, THE TEMPLATE SEEMS TO WORK AS INTENDED

Expected Behavior

APPLY A VALUE TO A YAML PROPERTY

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behavior caused by this plugin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions