Repository navigation
Replies: 1 comment
|
Hello @JSG-1, I transformed your issue into a discussion because I think it will be handled better like that. We recently introduced the form builder API to make this kind of operations easier. So, if you have your options in a variable named // you get your data somehow
const modalForm = app.plugins.plugins.modalforms.api;
const builder = modalForm.builder;
const form = projects.reduce((b, project) => {
return b.toggle({ name: project.name, label: "Whatever you want" })
}, builder("example-contact-form", "Example Contact Form")
)
.build()
// Open the form modal
modalForm.openForm(form);Please note I just made that from memory, it may not be 100% correct |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi @danielo515
Problem:
I am trying to use your plugin to render a list of my current projects, so I can chose which ones I want to update during my weekly review. I already have a script that gathers a list of project folder notes, and I want to dynamically present each project as a checkbox in a modal. However, obsidian-modal-form seems to only allow static field definitions.
Question:
How can I use the list (that my script generates) to dynamically create the checkbox fields at runtime, so I can pick which projects I want to update today? Is there a recommended approach or workaround to feed a custom field list directly into your plugin’s modal? Any guidance would be greatly appreciated!
Best regards,
JSG
All reactions