Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Entity Usage 5.0.0 Major update available for module entity_usage (5.0.0). Release: Entity Usage 8.x-2.3 Minor update available for module entity_usage (8.x-2.3). Release: Excel Serialization 2.2.0 Minor update available for module xls_serialization (2.2.0). Release: TMGMT DeepL Integration 2.4.2 Minor update available for module tmgmt_deepl (2.4.2). Release: Disable Login Page 1.2.0 Minor update available for module disable_login (1.2.0). Release: Akamai 5.1.1 Minor update available for module akamai (5.1.1). Release: GraphQL 5.1.0 Minor update available for module graphql (5.1.0). Release: agGrid 8.x-1.8 Minor update available for module aggrid (8.x-1.8). Usage Milestone: Easy Email Module easy_email crossed 10,000 active installs. Module Revived: Gleap 1.0.6 Module gleap updated after 7 months of inactivity (1.0.6).

Iframe

13,653 sites Security covered Drupal 10–11

Part of the Iframe ecosystem · 6 projects

View on drupal.org

This module provides a custom field type that allows you to embed iframes into your content. You can specify the source URL, dimensions, and optionally add a title and target attribute for the iframe.

  • Branch 8.x-1.x old branch (old templates, only bugfixes, deprecated)
  • Branch 8.x-2.x we are extending the module using twig templates and fixing settings of field-general, field-instance, field-display (current stable branch)

A custom field, which lets you add a complete iframe to your content types; including Src-URL, setting width and height, optionally a title above, and optionally a target attribute.

Related projects
  • The module iframe is based upon project Link by quicksketch
  • Used by Iframe Media Embed Video - provides a new media source type that allows to embed a video inside an iframe, and reuse it using the media library.

Data model

The iframe module provides a custom content "field" type. It provides some inputs for attributes of the iframe to an authorized user:

  • Src-URL (textfield)
  • Width of iframe (textfield), allowed: numbers (in px, without "px") btw. percents (e.g. "70%")
  • Height of iframe (textfield), dito
  • Title (textfield), optionally
  • Attributes for "frameborder" and "scrolling" (selects)

"Title" can be optionally enabled or disabled when setting up the content field.

If you were to create a field named 'MyIframe', the default display of the link would be:

<div class="field_myiframe">
  <h3>[Title]</h3>
  <iframe src="[URL]" width="[width]" height="[height]" target="[target_value]" class="iframe myclass">[URL]</iframe>
</div>

where items between [] characters would be customized based on the user input.

Installation

Composer

composer require "drupal/iframe ~2"

Manual install

  • Drop the entire iframe module directory into your modules folder
  • Enable the module from the Administration area modules page (admin/build/modules)
  • Create or Edit a content-type and add a new field of type iframe (admin/content/types)

Configuration

Configuration is only slightly more complicated than a text field. Title for iframe can be made required, optional (default), or left out entirely. If no title is provided, there will not be displayed any extra heading.

Theming

You can find more information on how to theme the output (and all other CCK fields) at the fields theming page

We are using templates/iframe.html.twig

Help

If you have questions or trouble, please post to the issue tracker rather than the forum.

The migration iD6-to-D7 via cck/content_migrate module now works completely (all attributes will be migrated too)!

Migration D6-to-D8 works basicly. Migration D7-to-D8 is straight forward without difficulties, because both use the field api from drupal core.

Depends on

Dependencies of the latest stable release

  • field Drupal core
  • link Drupal core

Required by

1 tracked project depends on this one

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
2 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
3.0.2 Stable 10–11 Jul 1, 2026
3.0.1 Stable 10–11 Jun 17, 2026