iframe_resizer
Introduction
This module makes the iFrame Resizer javascript library available on your Drupal site. With it enabled, you can "keep same and cross domain iFrames sized to their content with support for window/content resizing, in page links, nesting and multiple iFrames."
In other words, if you're sick of seeing scrollbars on content iFramed into your site, this module will help you by dynamically resizing iFrames so that no scrollbars are present.
See the library's homepage for information on its capabilities: http://davidjbradshaw.github.io/iframe-resizer/
Requirements
This module requires the iFrame Resizer javascript library to be installed in Drupal's "libraries" directory.
Important Note: The 5.x library version is not supported as it requires a commercial license for commercial environments. Please use version 4.x.
To install the required library via composer (recommended):
- Enable usage of third-party libraries using composer, see here for an explanation.
- Run
composer require bower-asset/iframe-resizer:^4
Installation
- Download the library or install via Composer (see Requirements above).
- If installing manually, unpack and rename the resulting directory "iframe-resizer" and place it in your Drupal installation's "libraries" directory.
- Install as you would normally install a contributed Drupal module. See: https://drupal.org/documentation/install/modules-themes/modules-7 for further information.
-
If your site will be hosting resizable iFrames, the page your site will be iFraming in must include the content window file from the iFrame Resizer library (i.e. The iFramed page must contain the
js/iframeResizer.contentWindow.jsorjs/iframeResizer.contentWindow.min.jsfile), and the 'This site will host resizable iFrames.' checkbox must be checked on your site's configuration page (admin/config/user-interface/iframe_resizer). -
If your site will be hosted within a resizable iFrame, the page hosting your site must include the main file from the iFrame Resizer library (i.e. The page iFraming in your site must contain the
js/iframeResizer.jsorjs/iframeResizer.min.jsfile), and the 'Pages from this site will be hosted within iFrames that have been made resizable by the iFrame Resizer JavaScript library.' checkbox must be checked on your site's configuration page (admin/config/user-interface/iframe_resizer).
Configuration
-
Configure user permissions in Administration » People » Permissions:
- Administer the iFrame Resizer module Users in roles with the "Administer the iFrame Resizer module" permission will be able to configure the behavior of the iFrame Resizer module.
-
Customize the module settings in Administration » Configuration » User interface » iFrame Resizer:
-
The iFrame Resizer Usage fieldset At least one of the checkboxes in this fieldset should be checked, otherwise the module won't do anything.
-
The Advanced Options for Hosting Resizable iFrames fieldset This fieldset will appear if the 'This site will host resizable iFrames.' checkbox is checked. It will allow you to override the library's default behavior.
-
The Advanced Options for Hosted Resizable iFrames fieldset This fieldset will appear if the 'Pages from this site will be hosted within iFrames that have been made resizable by the iFrame Resizer JavaScript library.' checkbox is checked. It will allow you to override the library's default behavior.
-