Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

JVM requirements

Java 1.6 and above

Installation requirements

(tick) Universal Plugin Manager
(error) Cannot be installed in /WEB-INF/lib

Section
Column

Description

Excerpt

Collection of macros for rendering HTML and related markup inside a Confluence page.

  • HTML macro - Renders HTML markup code and scripts inside a Confluence page (described below)
  • XSLT Macro

HTML Macro

Features

  • Supports security restrictions as described in CMSP.
  • Supports capabilities for including data similar to other scripting macros.

Other HTML macros

Column
width50%

Compatibility

Wiki Markup
{csv:output=wiki}
Plugin \ Confluence, 2.x, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, 4.2, Tested releases
3.3.0,               (x), (x), (x), (x), (x), (x), (/), (x), (/), (/), "4.1.7, 4.2.1"
3.2.0,               (x), (x), (/), (/), (/), (/), (/), (/), (/), (/), "3.1.1, 3.4.0, 3.5.13, 4.0.0, 4.1.0, 4.2.1"
3.1.0,               (/), (/), (/), (/), (/), (/), (/), (/), (/), (/), "2.7.1, 2.9.2, 3.1.1, 3.4.0, 3.5.0, 4.0.0"
...
{csv}
Warning
titleConfluence 4.x

You must disable the html-migration macro provided in the Atlassian bundled Confluence Html Macros pluginĀ under System Plugins in order to avoid Unknown Macro errors when inserting wiki markup with the html macro. Or surround with the wiki macro (Confluence Wiki Plugin) or any other non-migrated (compatibility mode) macro. Unfortunately, Atlassian ships the html-migration macro as enabled even though their html macro is disabled. This causes any html macro to be migrated without a supporting macro (sad). See CONF-25656.

html macro works in compatibility mode - see Confluence 4.0 compatibility for Table and other plugins

Security

Tip
titleMacro Security Plugin

If you have untrusted users on your site, then you should setup CMSP before enabling the html plugin.

Documentation

  • Help available in the notation guide.

Parameters

  • output- Determines how the output is formated:
    • html - Data is output as HTML (default).
    • wiki - Data is surrounded by a {noformat} macro.
  • script- Location of HTML data. Default is the macro body only. If a location of data is specified, the included data will follow the body data.
    • #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
    • #http://... - Data is read from the URL specified.
    • ^attachment - Data is read from an attachment to the current page.
    • page^attachment - Data is read from an attachment to the page name provided.
    • space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
  • noPanel - When output=wiki, show the data within a panel (default) unless nopanel=true
  • encoding - File encoding for an external file if different from the system default handling. Example: UTF-8.
  • clean - Default is true. Some HTML tags (like body and html) are removed to help with formatting in Confluence. Set to false to surround the complete html with an iframe.
  • width - Default is 500. Sets the width for the iframe (when clean=true).
  • height - Default is 500. Sets the height for the iframe (when clean=true).

Usage

Example - HTML from a file in the script folder in the Confluence home directory

No Format
{html:script=#example.html}
{html}

Example - HTML from an attachement

No Format
{html:script=^example.html}
{html}

Example - HTML put within {noformat} panel

No Format
{html:output=wiki|noPanel=true}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam fermentum vestibulum est. Cras rhoncus.
{html}

Example - HTML from an URL

No Format
{html:script=#http://localhost/example.html}
{html}

Example - use of CSS inline style sheet

No Format
{html}
<P style="font-size: x-large; color: #8000">
   Using inline style sheets - or is that inline styles?
</p>
{html}

Example - use of CSS external style sheet

No Format
{html}
<LINK href="http://www.cssgarden.com/css/T22/keylime_0001.css"  rel="stylesheet" title="default" type="text/css"></LINK>
<H1>Absolute </H1>
{html}

...