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
> What is an LMS lite for me? For us to be helpful, we need more details than "Courses: several lessons (web page, pdf, video, audio, quiz), sequence of lessons." Here is a very lite version of...
Is it possible to create a LMS site ?
OK, I did some more testing and figured this one out. In the paragraphs field setting for each content type you are using them, you can make the following selection for Default Edit Mode. I was in...
How to use 'Paragraphs Editor Preview'
Typically in a basic site, and as far as I know (I may be wrong) Backdrop doesn't store cookies for anonymous users, EXCEPT if you have things that need to persist, for example, if you create a View...
Does Backdrop set any Cookies / session variables for guests?