Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Using templater and system.prompt with several entries

Open hydraInsurgent opened this issue 1 year ago • 5 comments

I am trying to insert text from a template and ask the user(self) questions about my day, like emotion, mood, how was day, etc in the pop-up by using system.prompt(). It gets tedious to have multiple popups appear for different things I want to ask.

The prompt function is really great at taking input and converting it to the variable on runtime, but could we add a group prompt containing multiple prompts rendered similar to the image below from another plugin metadata menu(attached screenshot below), Tasks plugin also does something like this I remember.

I would like to have one grouped prompt for my emotions and other for Mood, each can have multiple questions like, what is mood, what factors are influencing it, how is your behavior affected by your mood ... so on. We can have different types of input as well like checkboxes, text boxes, select lists, and date pickers later as enhancements to the usability of grouped prompts.

Also, there can be multiple grouped prompts in a single document, so we do need to take care of this. Would love to see this in action on this plugin. Do let me know if you or anyone is interested to work on this idea, willing to put in some effort myself but I am new to plugin development so might need some assistance there.

Attachment image

hydraInsurgent avatar Mar 19 '23 08:03 hydraInsurgent

Hmm I think this has come up once or twice. I'm unsure what the best idea for this is, to allow a simpler version like being able to render multiple elements in a single modal or a more complex version where you can embed your own HTML components. There's a React plugin that lets you make your own components like that. Anyhow, the simpler version is very much doable and I'm up to help but be warned that Templater is a somewhat complex plugin and may be challenging if you haven't programmed before.

AB1908 avatar Mar 20 '23 06:03 AB1908

@AB1908 , thank you for your offer. I think there should be both options available so people can choose whatever they want simple one is really nice too. I am going to discuss this idea in the Metadata menu community and also if we can implement their popup via javascript on runtime in some way. Will ping you if I need some help with the Templater.

hydraInsurgent avatar Mar 24 '23 05:03 hydraInsurgent

Hello I am interested in this feature, what is the status of those conversations mentioned?

It seems other people are also interested in something like this:

  • #1059 (this)
  • #1130 (speaks of a problem solved by this)
  • #976

NotNotQuinn avatar Jul 08 '23 08:07 NotNotQuinn

No one has picked it up yet. There isn't anyone to review and merge either though Zachatoo and I do review this stuff occasionally.

AB1908 avatar Jul 11 '23 12:07 AB1908

This plugin appears to be tackling this issue.

https://github.com/danielo515/obsidian-modal-form

Zachatoo avatar Oct 04 '23 02:10 Zachatoo