You’re not alone in wanting this kind of capability. And you’re not alone in thinking, at first glance, that custom fields would do it. Custom Fields were implemented for a specific purpose quite a while back, which didn’t require the fields to become variables. That’s probably not the way it should have gone, but I don’t know that it’s safe to change the semantics now…there ought to be a way to do what you want, however. It would make Server Templates vastly more powerful and flexible.
I’ll file a wish in the bug-tracker and we’ll see if Jamie can see an easy/safe way to make this possible. I think it would be a very useful trick.
This is already possible using custom fields. In a template, they can be referenced as FIELD_XXX where XXX is the custom field name, and in pre/post scripts they can be found in the VIRTUALSERVER_FIELD_XXX environment variables…
I’d like to be able to create a section in my vhost conf that can be included or excluded based on the value of a custom field (for rudimentary coldfusion support)
This would require some sort of if-field/elseif-field/else syntax, like the ones included for the built in variables.
I’ve been hoping for something like this for a while now