You are here

iframe.html.twig in Iframe 8.2

Default theme implementation to display an iframe field.

Available variables:

  • src: Url being loaded into the iframe.
  • attributes: An array of HTML attributes, intended to be added to the iframe tag.
  • text: Title text.
  • style: style Block

File

templates/iframe.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display an iframe field.
  5. *
  6. * Available variables:
  7. * - src: Url being loaded into the iframe.
  8. * - attributes: An array of HTML attributes, intended to be added to the iframe tag.
  9. * - text: Title text.
  10. * - style: style Block
  11. */
  12. #}
  13. <div{% if attributes.class is not empty %} class="{{ attributes.class }}"{% endif %}>
  14. {% if text is not empty %}
  15. <h3 class="iframe_title">{{ text }}</h3>
  16. {% endif %}
  17. <style type="text/css">{{ style|raw }}</style>
  18. <iframe {{ attributes }}>
  19. {{ 'Your browser does not support iframes, but you can visit <a href=":url">@text</a>'|t({ ':url': src, '@text': text }) }}
  20. </iframe>
  21. </div>