{% macro autosuggestField(config) %} {% import '_includes/forms' as forms %} {# Suggest an environment variable / alias? #} {% if (config.suggestEnvVars ?? false) %} {% set value = config.value ?? '' %} {% if config.tip is not defined and value[0:1] not in ['$', '@'] %} {% set config = config|merge({ tip: ((config.suggestAliases ?? false) ? 'This can be set to an environment variable, or begin with an alias.'|t('app') : 'This can be set to an environment variable.'|t('app')) ~ ' ' ~ 'Learn more'|t('app') ~ '' }) %} {% endif %} {% endif %} {% if forms.autosuggest is defined or forms is defined %} {{ forms.field(config, forms.autosuggest(config)) }} {% else %} {{ forms.textField(config) }} {% endif %} {% endmacro %}