Show or hide custom fields depending on which template is used

We use Virtualmin's excellent "Custom Fields" to reflect custom fields in "Additional information" section and to get values for some settings from the user and pass them to post creation script. Which in turn triggers enabling or disabling some custom features like, for example, Varnish or Memcache.

This works generally fine, but the biggest problem is that the additional options are shown on creating or editing any virtual server of any template. For example, when creating aliases we really didn't have to show our users those additional fields as shown in the attached screenshot.

I wonder if it is possible to show/hide division depending on which template is used at given moment?



I see what you mean, and this makes sense ... I will look into it.

Longer term if you have complex additional feature requirements, writing your own Virtualmin plugin may be a better choice.

Unfortunately, our staff writes in bash and Virtualmin plugins in Perl.

Perl and bash aren't really that much different :-)

Well, our coder, Denis, tried to modify the existing Drupal installation script and found out that it is too much integrated into Virtualmin's own scripts and concluded it was too confusing and difficult. So he wrote a post installation bash script where we install Drupal with drush (much easier and faster way than relying on Virtualmin's Drupal installation script). So we are dependent and have to go by what our coders say. As for myself I am a good system administrator, but not much of a coder, unfortunately.