- Issue created by @shabana.navas
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
Thanks for the patch. Please put it in an issue fork and merge request.
Currently, everything else on a webform can be overridden with exception to the title and description. This is something that is needed as sites might create variants that should have different title and description based on conditions like domain or language, etc.
Add a new webform variant that overrides the title and description. In `buildConfigurationForm()`
$form['overrides']['title'] = [
'#type' => 'textfield',
'#title' => $this->t('Title'),
'#description' => $this->t('Enter the overridden title of the webform.'),
'#default_value' => $this->configuration['title'] ?? NULL,
'#weight' => -10,
];
$form['overrides']['description'] = [
'#type' => 'textarea',
'#title' => $this->t('Description'),
'#description' => $this->t('Enter the overridden description of the webform.'),
'#default_value' => $this->configuration['description'] ?? NULL,
'#weight' => -5,
];
In `submitConfigurationForm()`:
$this->configuration['title'] = $this->configuration['overrides']['title'];
$this->configuration['description'] = $this->configuration['overrides']['description'];
Alter `applyVariant()` function to override the title and description if an override exists for the variant.
Active
5.0
Code
Thanks for the patch. Please put it in an issue fork and merge request.