Table of Contents |
---|
maxlevel | 2 |
---|
minlevel | 2 |
---|
type | flat |
---|
separator | pipe |
---|
|
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
Table plus |
---|
ParameterMacro Editor Label | Default | Description | Macro |
---|
Browser LabelDescription | outputFormat | Determines 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.
| scriptmacro body | Location of HTML data | macro 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 laterspace: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.
| findscript | 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) | replaceComma
| Enter a comma separated list corresponding to find patterns via index position in list. | Single quote entries containing . Exampleis a part of an entry, use single quotes around it. Example: $1$base_url$2 | replace | File encoding | system default | File Encoding for an external file, if different from the system default handling. Example: UTF-8. | tidyclean | true | Remove conflicting tags | Allows 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. |
---|
head | false | Include head section HTML | Only 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. |
---|
noPanel | false | Omit panel when output is wiki | A way of setting the nopanel parameter of the noformat macro. Only matters when output=wiki. |
---|
width | 500 | Width of iframe | Only in affect for clean=false. |
---|
height | 500 | Height of iframe | Only in affect for clean=false. |
---|
user | URL user false | Select to use JTidy | JTidy 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 connection |
| User password for URL access via basic authentication. | timeoutTimeout in milliseconds | URL 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. |