Lets you embed references to ColdFusion pages in CFML. You can embed cfinclude
tags recursively. For an additional method of encapsulating CFML, see cfmodule.
<cfinclude template = "template_name">
cfcache,
cfflush,
cfheader,
cfhtmlhead,
cfsetting,
cfsilent
Attribute |
Description |
---|---|
template |
A logical path to an existing page. |
ColdFusion searches for included files as follows:
<!--- 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>