1

I'm new to using the Webform module, and started with the Contact form provided on install. I have added a Webform block to the Content region, but it doesn't show up on the front-end at all (even when I remove all restrictions such as only showing on certain pages).

I thought it might be a permissions issue, so I checked that all roles have access to see the form. When I tick "Allow users to post submissions from a dedicated URL" and choose a path, both anonymous and logged-in users can view the form at that URL. It's only when it's a block that it doesn't show up. I have also tried clearing the cache, and placing the block in other regions.

I am using Drupal 9 with Webform 6.0.0.

Edit: After some suggestions below I have also tried:

  • Another theme: The issue does not happen in the parent theme of my sub-theme, narrowing it down to a possible theme-level issue.
  • Deleting my theme's overrides of region.html.twig and block.html.twig. The issue persists in my theme.
  • Placing a HTML comment in block.html.twig before any Twig code, to check when that file is being used (i.e. it might be loaded, but have a problem with the output code). It is not rendered at all for this specific block.

What are some other possible things that can cause the block to not show up?

4
  • Are you sure you added the block to the theme you are currently using? If you have multiple themes enabled, it's easy to add the block to a different theme. Commented Jan 13, 2021 at 13:31
  • @PatrickKenny Yep, definitely the right theme, but your suggestion made me think to go and try it on another theme and it works, so it must be a theme-level problem. It's my own sub-theme and it works in the parent so that narrows it down, thanks! Commented Jan 13, 2021 at 23:06
  • In that case, it's possible that the theme is not rendering the region that you placed the block into. Commented Jan 14, 2021 at 1:45
  • There's other blocks in that region which are displaying fine, but block.html.twig doesn't render for this specific block at all. I've tried plating it in other regions, and temporarily deleting my overrides of region.html.twig and block.html.twig to see if one of my templates is the problem, but the issue persists. Is there a way of getting debug information about which blocks are assigned to a region? All dump(content) gets me in the region template is a copy of the HTML output. Commented Jan 14, 2021 at 2:15

1 Answer 1

0

Rather than checking the block's config in the existing instance, delete it and re-insert it, checking the settings again in the insertion screen. It now shows up for me after doing it this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.