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
1 theme call to iframe.html.twig
- IframeDefaultFormatter::iframeIframe in src/
Plugin/ Field/ FieldFormatter/ IframeDefaultFormatter.php - Like central function form the iframe code.
File
templates/iframe.html.twigView source
- {#
- /**
- * @file
- * 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
- */
- #}
- <div{% if attributes.class is not empty %} class="{{ attributes.class }}"{% endif %}>
- {% if text is not empty %}
- <h3 class="iframe_title">{{ text }}</h3>
- {% endif %}
- <style type="text/css">{{ style|raw }}</style>
- <iframe {{ attributes }}>
- {{ 'Your browser does not support iframes, but you can visit <a href=":url">@text</a>'|t({ ':url': src, '@text': text }) }}
- </iframe>
- </div>