You are here

bs-video-background.html.twig in Bootstrap Styles 1.0.x

Default theme implementation of a container used to wrap child elements.

Used for grouped form items. Can also be used as a theme wrapper for any renderable element, to surround it with a <div> and HTML attributes. See \Drupal\Core\Render\Element\RenderElement for more information on the #theme_wrappers render array property, and \Drupal\Core\Render\Element\container for usage of the container render element.

Available variables:

  • attributes: HTML attributes for the containing element.
  • children: The rendered child elements of the container.
  • has_parent: A flag to indicate that the container has one or more parent containers.

File

templates/bs-video-background.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of a container used to wrap child elements.
  5. *
  6. * Used for grouped form items. Can also be used as a theme wrapper for any
  7. * renderable element, to surround it with a <div> and HTML attributes.
  8. * See \Drupal\Core\Render\Element\RenderElement for more
  9. * information on the #theme_wrappers render array property, and
  10. * \Drupal\Core\Render\Element\container for usage of the container render
  11. * element.
  12. *
  13. * Available variables:
  14. * - attributes: HTML attributes for the containing element.
  15. * - children: The rendered child elements of the container.
  16. * - has_parent: A flag to indicate that the container has one or more parent containers.
  17. *
  18. * @see template_preprocess_container()
  19. *
  20. * @ingroup themeable
  21. */
  22. #}
  23. {%
  24. set classes = [
  25. has_parent ? 'js-form-wrapper',
  26. has_parent ? 'form-wrapper',
  27. 'background-local-video',
  28. ]
  29. %}
  30. {{ attach_library('bootstrap_styles/plugin.background_media.build') }}
  31. <div{{ attributes.addClass(classes) }}>
  32. <video playsinline="playsinline" autoplay="autoplay" muted="muted" loop="loop">
  33. <source src="{{ video_background_url }}" type="video/mp4">
  34. </video>
  35. <div class="video-content">
  36. {{ children }}
  37. </div>
  38. </div>