Hello,
I want to create an automation that runs when a virtual server is created, but for this, I need an input (string) from users. So I want to add the field on the virtual server creation page as the image. Can anyone help me, How can I do it? I can use the “post-modification” to run the automation, but how can I get the string from the users?
Thank you.
If I understand what you’re asking, you can use $VIRTUALSERVER_FIELD_fieldname
in your scripts, as documented here: Template Variables | Virtualmin — Open Source Web Hosting Control Panel
Hello Joe,
Thank you for your response. But this is how I can get the custom fields values which I created from System customization >> Custom Fields.
But my question is may I create a field like this with a plugin and how?
Thank you.
Ah, ok…hmm… I’m pretty sure that’s possible, as I think the nginx plugin sets some variables, but maybe it’s just the same data that is available from core when using Apache. Have you looked at any of our plugins for clues? Almost all Virtualmin plugins are open source in our GitHub.
Looks like maybe the envs_to_set
hash is for this purpose?