• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part: VII Appendixes > Include Pages with ColdFusion

Include Pages with ColdFusion

When you use the <cfinclude> tag, the contents of a ColdFusion page can be included inside another ColdFusion page. This means that you need to write a certain task only once and include it in as many pages as you want. A common but basic use of include pages is to provide standard headers and footers for pages. Then, if the company details change or you want to update the design, the change needs to be made in only one file.

The process of inclusion is shown in Figure E.9. The <cfinclude> tag has a template attribute that specifies the file to include. The contents of this file are then inserted into the page at the point of the <cfinclude> tag. This content is treated the same as if it were in the calling page. The included content can be anything you like—HTML, CFML, or JavaScript, for instance. The included page will have access to all the variables in the calling page, so code can be run within it, referring to page specific values and parameters.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint