Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: human readable select fields #35

Open
a-kempka opened this issue Nov 28, 2022 · 3 comments
Open

Feature request: human readable select fields #35

a-kempka opened this issue Nov 28, 2022 · 3 comments

Comments

@a-kempka
Copy link

Thank your for your wonderful plugin!

We'd love to be able to use Generico with human readable select fields to customize Generico forms:
In a variable the text presented to the user invoking the form should contain a custimozable text, e.g. "warning sign", choosing this option would put a different text not visible to the user (e.g. containing some HTML like ""). There are ways around that problem using JavaScript, but they are not user friendly to template designers.

Do you find this feature useful and could you implement this?

@justinhunt
Copy link
Owner

I am not sure what you mean here. Could you give me a more complete example?

It is possible now to make simple dropdowns for template users, by specifying the options in the template defaults area:
eg. color="red|blue|green"

Also underscores will be replaces by spaces and (I think) variable names capitalized.
e.g max_limit would become "Max Limit"

@a-kempka
Copy link
Author

My goal was to provide the user of a template with a easily understandable text in the drop down selection. Based on the selection a different (associated) content would be passed as a variable to Generico.

It would be really convenient to be able to specify the option value and the underlyying text directly in Generico.
The variables could be declared like: color=red[alert-danger]|green[alert-success]|blue[alert-info] or in any other convenient syntax.
As a result the drop down menu would show the readable options red|green|blue, but upon choosing an option Generico would pass the approriate text like "alert-danger|alert-success|alert-info" into the template.

@justinhunt
Copy link
Owner

Yes, something like that could be done. It just means a few hours of regular expression fun. I will try and do that, but it will not be immediately. Thanks for the suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants