mo-seph / obsidian-note-from-template

Simple plugin to create Notes from a template, and fill in fields defined there
MIT License
107 stars 9 forks source link

[Feature Request] Dropdowns: support for {{variable}} #14

Open FelipeRearden opened 2 years ago

FelipeRearden commented 2 years ago

Hello @mo-seph !!!!

I wanna suggest a new feature for the new dropdowns feature .

My FR is the ability to insert {{variable}} filed inside the dropdown syntax.

Example

Choosing between Pie and Juice for today Menu

---
template-output: "Menus"
template-filename: "Today Menu"
---

Option for Today: {{dish}}

The Special dish is: {{Options:Apple {{dish}}:Mango {{dish}}:Strawberry {{dish}}}}

I think this could be a great option to make the creator modal even more dynamic :)


Thanks foe reading !

Have a great day!

emisjerry commented 2 years ago

+1 for Tags selection

mo-seph commented 2 years ago

I'm unlikely to do this - at the moment, it works like this: reading in the template, getting any variables from the selected text, creating the UI, creating a note based on the final state of the UI.

To do something dynamic like this would require a second level of filling things in, and it's going to make it rather fiddly. So unless it all gets majorly rewritten, I probably won't go in this direction.

As a note, you could do the example above with:

The Special dish is: {{Options:Apple:Mango:Strawberry}}  {{dish}}
FelipeRearden commented 2 years ago

Thank for your reply @mo-seph !

I understand and it's okay :)

Thanks for the suggestion. I gonna try later. In my mind, if I did dish twice, I would need to 3 text fields instead of 2.

Thank you very much!