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 Javascript is inserted while using the macro.

Other HTML macros



Tip

By default, header content is excluded as it could interfere with Confluence page HTML. Use head=true to include anyway provided it does not disturb the content.

Parameters

output
Table plus


Parameter
Macro Editor LabelDefaultDescriptionMacro
Browser Label
Description
Parameter
Formathtml
FormatDetermines

Specify how the output is treated. The options are as follows:

  • html - data is entered as standard HTML directly in the macro body
  • 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.
script
output
macro body
Location of HTML datamacro body
If

Enter the location of data

is

. If 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 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
    script
    Find regex patterns
    Comma

    Enter a comma separated list of regex patterns to use to post-process the output HTML with find and replace logic. Example: (href=)(/display)

    replace
    find
    Replacement strings
    Comma

    Enter a comma separated list corresponding to find patterns via index position in list.

    Single quote entries containing

    If a comma

    . Example

    is a part of an entry, use single quotes around it. Example: $1$base_url$2

    replace
    File encodingsystem default
    File
    Specify the encoding
    Encoding
    for an external file, if different from the system default handling. Example: UTF-8.
    tidycleantrueRemove conflicting tagsAllows display in Confluence page without an iframe. Removes HTML, body and (optionally) the head tags including their corresponding ending tags so that it displays properly on a Confluence page.
    If 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, if set as true, it retains all the other tags from the head section and 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.userURL user 
    encoding
    falseSelect to use JTidyJTidy ensures HTML is well formed which can prevent page display problems.
    Timeout in milliseconds
    Enter time in milliseconds such that URL connections does not timeout before getting data. Use this to increase time needed for slow connections. Note that if a zero is given the connection may wait infinitely. Be careful when using 0 as the connections would be in an infinite wait.timeout
    User id for URL connection 
    User name for URL access via basic authentication.
    password
    user
    Password for URL
    user password 
    connection
    User password for URL access via basic authentication. 
    timeout
    password
    Timeout in millisecondsURL connections may timeout before getting data. Use this to increase time needed for slow connections. Be careful when using 0 as the connections would be in an infinite wait.

    Usage

    ...


    Examples

    The following examples show how you can use the macro to render HTML content:

    • HTML from a file in the script folder in the Confluence home directory

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

    ...


    • HTML from an attachment

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

    ...


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

    ...


    • HTML from an URL

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

    ...


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

    ...


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


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