Content Formatting Macros for Confluence Server and DC

Iframe

The Iframe macro allows the display of a web page within a web page.

Iframe Macro Configuration:

The Iframe macro is configured by the Confluence administrator and by default will be rendered with the sandbox attribute.

Learn more about the Iframe Macro Configuration here: Iframe Macro Configuration

Usage

  1. Go to the form you wish to edit.

  2. Click Edit.

  3. Click Insert More Content, and select Other Macros.

  4. Select the iFrame macro from the provided list.

    iframe 01
  5. Complete the desired fields.

    Parameter Description Type Default Required

    URL

    The URL of the document to show in the Iframe

    string

    none

    check

    ID

    Specifies a unique ID to be added to the element

    string

    none

    error

    CSS Class

    Specifies a CSS Class to be added to the element

    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

    Sets the language code

    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. The macro will then appear on the page.

    iframe 02

Known Issues

Content That Previously Worked No Longer Displays

The Iframe macro shows a blank area instead of imported content, as seen in the example above. This Iframe used to work as expected but now shows a blank box.

iframe 03

Reason for Blank Display

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

  • The administrators of the website have set an option on their server that will deny the inclusion of their sites content in Iframes.

  • This setting is called the The X-Frame-Options response header, as described by Mozilla.

    • This is the reason why our example above no longer works. The Atlassian Marketplace server is using 'X-Frame-Options: DENY' in its HTTP header.

  • 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.

Possible Solutions

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

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

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

  • 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