Why is not my customized Kind API #states utilized in my webform yaml editor working?

I’ve Drupal Development Company must set visibility state of a checkbox possibility in a single query (Desk checkbox choose) primarily based on Drupal Development Company worth of one other checkbox in Drupal Development Company similar desk. I additionally produce other eventualities the place I would want similar performance however throughout totally different questions in Drupal Development Company similar webform.

I do know I can simply do it between two totally different questions ( 2 totally different parts) with Drupal Development Company built-in conditional logic UI in webform however no such UI possibility for my case now (afaik) so I am making an attempt to set it by way of Drupal Development Company customized one and that is my first time with type states and customized situation in webform so I recognize your type assist so vastly.

I went by means of trials and errors and Drupal Development Company code wasn’t being saved until I, because of @jrockowitz ‘s tip, learnt that I used to be utilizing php code the place I want to make use of yaml code since I am utilizing Drupal Development Company yaml supply editor (proven in Drupal Development Company screenshot under). Once I fastened that, my customized code would save and it displays as entered in Drupal Development Company webform supply yaml. Nevertheless, Drupal Development Company customized situation continues to be not working as anticipated and I am nonetheless unsure why.

I am including Drupal Development Company code in Drupal Development Company Edit supply field accessible by way of clicking its hyperlink on Drupal Development Company type “Circumstances” tab.

I obtained Drupal Development Company selectors for Drupal Development Company concerned query choices from Drupal Development Company “Obtainable selectors” checklist by clicking on Drupal Development Company “Assist” hyperlink underneath “Be taught extra about Drupal’s Kind API #states.” on Drupal Development Company “Conditional Logic” for Drupal Development Company factor modifying tab in my webform.

It is a pattern full yaml code for Drupal Development Company type with a pattern query and what I need to obtain however not but working:

some_question:   '#kind': tableselect   '#title': 'some query'   '#choices':     q1: 'q1 (disguise if q2 is checked)'     q2: 'q2 (disguise if q1 is checked)'     q3: q3     this autumn: this autumn     q5: q5     q6: q6     q7: q7   '#states':     ':enter[name="some_question[q2]"]':       invisible:         ':enter[name="some_question[q1]"]':           checked: true     ':enter[name="some_question[q1]"]':       invisible:         ':enter[name="some_question[q2]"]':           checked: true            

What am I lacking right here ?!

  • For individuals who possibly aren’t accustomed to Drupal Development Company UI edit supply, this can be a hyperlink with data and screenshots : https://www.drupal.org/node/3012686

  • Be aware: As per @leymannx ‘s type recommendation, I re-wrote Drupal Development Company entire query to rid it of my dump of updates with my trials and errors. I hope it is now cleaner, clearer and extra worthy of up-votes 🙂

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Why is not my customized Kind API #states utilized in my webform yaml editor working?

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.