I was reviewing #4509 and was playing with @indigoxela's PR on my local, trying to conditionally show/hide a warning if webp was added to the list of allowed extensions for an image field instance.
A condition like this, where the value is "static" works fine:
'#states' => array(
'visible' => array(
':input[name="instance[settings][file_extensions]"]' => array('value' => 'png, gif, jpg, jpeg, webp'),
),
),
But the goal is to check the value of the field for any occurrence of webp. Unfortunately, #states doesn't seem to support regex OOTB
With some research, I've found this article: https://evolvingweb.ca/blog/extending-form-api-states-regular-expressions which would allow something like this:
'#states' => array(
'visible' => array(
':input[name="instance[settings][file_extensions]"]' => array('regex' => array('value' => '^.*webp.*$')),
),
),
Recent comments
This is a security precaution. It's not recommended and it's not documented in the settings.php file, but you can set allow_insecure_uploads to be TRUE if you wish to allow uploading files like...
How to upload js and gz files
You could also just add an image field to the content type but not display it and instead reference them in your markdown.
Images Disappearing from inline-images
You can create a small custom module using this hook: https://github.com/backdrop-contrib/webform/blob/136c20cb1c51cea203f3f0bc5355237c1d4dbf84/webform.api.php#L652-L678 /** * Determine...
specific webform permissions