Versions Compared

Key

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

Table of Contents
maxlevel2
minlevel2
typeflat
separatorpipe

...

Section


Column

Features

  • Supports security restrictions as described in CMSP.
  • Supports capabilities for including data similar to other scripting macros.
  • Supports find and replace for adjusting resulting output.
  • Allows the user to restrict the usage of Javascript in the HTML macro (based on the configuration of Allow Javascript in the Configuration page). The Confluence page throws a rendering error if this parameter is not enabled, and javascript is inserted while using the macro.

Other HTML macros


...

Table plus


ParameterDefaultMacro Browser LabelDescription
outputhtmlFormat

Determines how the output is treated.

  • html - standard HTML
  • xhtml - data is treated as XHTML and rendered with the Confluence XHTML renderer prior to display
  • wiki - data is surrounded by a noformat macro. This is a very special case.
scriptmacro bodyLocation of HTML data

If the location of data is specified, the included data follows the body data (if any).

  • #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
  • #http... - Data is read from URL. May required require the user and password parameters as well.
  • global page template name - Data is read from a global page template. Special note: How to deal with templates on Confluence 4.3 and later.
  • space:page template name - Data is read from a space template.
  • ^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.
find
Find regex patterns

Comma separated list of regex patterns to use to post-process the output HTML with find and replace logic.

  • Example: (href=)(/display)
replace
Replacement strings

Comma separated list corresponding to find patterns via index position in list. Single quote entries containing a comma.

  • Example: $1$base_url$2
encodingsystem defaultFile encodingEncoding for an external file if different from the system default handling. Example: UTF-8.
tidyfalseSelect to use JTidyJTidy will ensure the  ensures HTML is well formed which can prevent page display problems.
cleantrueRemove conflicting tagsAllows display in Confluence page without an iframe. Removes htmlHTML, body and (optionally) the head tags including their corresponding ending tags so that it displays properly on a Confluence page.
When not selected, the HTML is surrounded with an iframe.
headfalseInclude head section HTMLOnly in affect if clean=true. The head tag is always removed. However, setting this if set to true will retain , it retains all the other tags from the head section and treat treats them as regular body content. This is useful for retaining style information in particular.
noPanelfalseOmit panel when output is wiki A way of setting the nopanel parameter of the noformat macro. Only matters when output=wiki.
width500Width of iframeOnly in affect for clean=false
height500Height of iframeOnly in affect for clean=false
user
URL user User name for URL access via basic authentication.
password
URL user password User password for URL access via basic authentication. 
timeout
Timeout in millisecondsURL connections may timeout before getting data. Use this to increase time needed for slow connections. Be careful when using 0 for as the connections would be in an infinite wait.


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

...

attachment

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

...

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}


Info
Note:
Make sure that style sheet is available on a server and provide an absolute URL reference to this external style sheet resource.