CFINCLUDE

CFINCLUDE lets you embed references to ColdFusion pages in your CFML. If necessary, you can embed CFINCLUDE tags recursively.

For an additional method of encapsulating CFML, see the CFMODULE tag, used to create custom tags in CFML.

Syntax

<CFINCLUDE TEMPLATE="template_name">

TEMPLATE

A logical path to an existing page.

Usage

ColdFusion searches for included files as follows:

Example

<!--- This example shows the use of CFINCLUDE to paste
pieces of CFML or HTML code into another page dynamically --->
<HTML>
<HEAD>
    <TITLE>CFINCLUDE Example</TITLE>
</HEAD>

<BODY>
<H3>CFINCLUDE Example</H3>

<H4>This example includes the main.htm page from the CFDOCS
directory.  The images do not show up correctly because
they are located in a separate directory.
However, the page appears fully rendered within the
contents of this page.</H4>
<CFINCLUDE TEMPLATE="/cfdocs/main.htm">

</BODY>
</HTML>