You are here

gutenberg-block.html.twig in Gutenberg 8.2

Default theme implementation to display a Gutenberg block server-side. This template should be overridden, and is only used if there's no default theme override.

Available variables:

  • block_name: The Gutenberg block name.
  • block_content: The content of this block.
  • block_attributes: The attributes of this block.
  • attributes: array of HTML attributes populated by modules, intended to be added to the main container tag of this template.

File

templates/gutenberg-block.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a Gutenberg block server-side.
  5. * This template should be overridden, and is only used if there's no default theme override.
  6. *
  7. * Available variables:
  8. * - block_name: The Gutenberg block name.
  9. * - block_content: The content of this block.
  10. * - block_attributes: The attributes of this block.
  11. * - attributes: array of HTML attributes populated by modules, intended to
  12. * be added to the main container tag of this template.
  13. *
  14. * @see template_preprocess_gutenberg_block()
  15. *
  16. * @ingroup themeable
  17. */
  18. #}
  19. <div{{ attributes.setAttribute('style', 'background:red; color:white; padding:15px') }}>
  20. <div>
  21. {% trans %}
  22. Default server-side render for {{ block_name|placeholder }}. Override me!
  23. {% endtrans %}
  24. </div>
  25. <div>
  26. {{ 'Inner content:'|t }} {{ block_content }}
  27. </div>
  28. </div>