New answers tagged

0 votes

How to show webform as block

You can embed a webform programmatically: $webform = $this->entityTypeManager->getStorage('webform')->load(self::WEBFORM_ID); $build['content'][] = [ '#type' => 'webform', '#webform' =&...
  • 405
-1 votes

Google API callback doesn't work

Found the fix, the attach: function(....) wrapper line was affecting the visibility of the initMap function. Removing that cleared the error. Dynamically loading the script with JS would work as well, ...
0 votes

Google API callback doesn't work

You will need to ensure your library is loaded first, by creating it as a dependency of the first library: delivery: version: 1.x js: js/delivery.js: {} dependencies: - core/jquery - ...
  • 15.6k
0 votes

How can the Webform element Form display defaults be set?

It looks default title display is set in Drupal core: https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/lib/Drupal/Core/Form/FormBuilder.php#L923-930
0 votes

How do you override a module's template from another module?

The only way I found to get template override to work is to: add a template suggestion: // in web/modules/app/app.module function app_theme_suggestions_alter(array &$suggestions, array $variables,...
  • 111
2 votes
Accepted

Webform javascript CSS selectors with table

My heart is bleeding each time a developer starts working with Drupal and adds code to a Drupal site that doesn't take advantage of its features. When using JavaScript with Drupal, please ALWAYS ...
-2 votes

Webform javascript CSS selectors with table

I found a solution: using bubbling to attach the event to something other than the table stops the listeners from being removed every time a new row is added. jQuery('body').on('change', 'select.form-...

Top 50 recent answers are included