Use cfinclude to import html pages.
The cfinclude tag can also be used to import other pages than cfm pages.
This example will show how to import an htm page into a coldfusion page.
In this example we build a header cfm file, a footer cfm file and a link htm page and using cfinclude to include those templates to the 'output page'.
The header.cfm file:
|
< html>< head>< title>Your Title</title>< meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">< meta name="Language" content="en">< meta name="description" content="Site Description">< meta name="keywords" content="primary_keyword, secondary one, secondary two, secondary three, SECONDARY ONE, SECONDARY TWO, SECONDARY">< meta name="robots" content="INDEX,FOLLOW"></ head>< body bgcolor="#99CCFF">< div align="center">Navigation links</div> |
The footer.cfm file:
|
< br>< div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Copyright © 19xx - <cfoutput>#DatePart("yyyy", Now())#</cfoutput>. All Rights Reserved.</font> </div></ body></html> |
The link.htm file:
|
< a href="http://www.applayit.com" target="_blank">ApplayIt</a> |
The output.cfm file:
|
<!--- We include the header.cfm file. ---> < cfinclude template="header.cfm">< br><br><!--- We include the link.htm page. ---> < cfinclude template="link.htm"><!--- We include the footer.cfm file. ---> < cfinclude template="footer.cfm"> |
This will give the following output:
|
Navigation links Copyright ? 19xx - 2005. All Rights Reserved. |
Advertisement

No User Comments.
No User Comments, be the first one to write your comments?


