Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Implements hook_form_alter().
- */
- function mymodule_form_alter(&$form, DrupalCoreFormFormStateInterface &$form_state, $form_id) {
- $form['field_slideshow_image']['#states'] = [
- 'visible' => [
- 'select[name="field_selection_display"]' => ['value' => 'slideshow']
- ]
- ];
- $form['field_image']['#states'] = [
- 'visible' => [
- 'select[name="field_selection_display"]' => ['value' => 'image']
- ]
- ];
- $form['field_video_embed']['#states'] = [
- 'visible' => [
- 'select[name="field_selection_display"]' => ['value' => 'videoembed']
- ]
- ];
- }
Add Comment
Please, Sign In to add comment