The iFrame macro enables you to display a web page within a Confluence page.

The iFrame macro is configured by the Confluence administrator. By default, it is rendered with the sandbox attribute.

Learn more about the Iframe macro configuration before you begin.

Instructions

  1. Navigate to the page where you want to display a web page.

  2. Click Edit.

  3. Click Insert More Content Other Macros.

  4. Select the iFrame macro from the Macro Browser.

    The Macro Browser with the iFrame macro available.
  5. Complete the desired fields.

    ParameterDescriptionTypeDefaultRequired

    URL

    The URL of the document to show in the iframe.

    string

    none

    (tick)

    ID

    Specifies a unique ID to be added to the element

    string

    none

    (error)

    CSS Class

    Option to apply a custom CSS class to the element. Enter the CSS class name(s) to apply to the macro (case sensitive); multiple classes can be separated by a space or comma. Classes must be part of your Global Confluence CSS or defined in a CSS Stylesheet macro that you have added to your page.

    string

    none

    (error)

    Inline Style

    An optional inline style sheet to apply to the tag

    string

    none

    (error)

    Title

    Text to display in a tooltip

    string

    none

    (error)

    Width

    The width of the iFrame in px or %

    string

    none

    (error)

    Height

    The Iframe height in px or %

    string

    none

    (error)

    Long Description

    A url to a page which contains a long description of the content within the Iframe

    string

    none

    (error)

    Name

    Specifies a unique name of the Iframe (to use in scripts)

    string

    none

    (error)

    Text Direction

    Specifies the text direction

    single select

    none

    (error)

    Language Code

    Enter a language code if you want to specify that the element content language is different from the default language of your page, e.g. de for German. Browsers will identify that the content is written in German. 

    string

    none

    (error)

    Allow Full Screen Mode

    Allows Iframe to be viewed full screen

    checkbox

    unselected

    (error)

    The URL parameter must be specified for this macro to work.

  6. Click Insert. The macro placeholder displays.

  7. Save the page to view the web page in your Confluence page.

Known issues

Content that previously worked no longer displays

The Iframe macro shows a blank area instead of imported content. This Iframe used to work as expected but now shows a blank box.

An example of a rendered iFrame with unavailable content.

There are two reasons why content that used to display in the Iframe macro may no longer show in a Confluence page.

  1. The administrators of the website have set an option on their server that prohibits the inclusion of their site's content in Iframes. This setting is called the The X-Frame-Options response header, as described by Mozilla.
  2. The browser is stopping the inclusion of content from another site for security reasons. This is a feature of modern browsers called Mixed Content Blocking as described by Mozilla.

Solutions

Both the scenarios described above are beyond the control of the Iframe macro and its developers.

If you are affected by this problem, try one of the following:

  • Use https:// at the start of the Iframe source web address e.g. https://www.adaptavist.com - this can help with mixed content blocking.

  • Use an alternative method of importing content, such as the HTML Include macro - please read the caveats on the linked page carefully.

  • Remove the Iframe macro from the page and link directly to the content instead.