File Includes:
Description:
What is a file include? When a page is called from your site, the server checks for file includes. If it finds one, it pastes the code of the included file on the calling page before it sends it back to the user. File includes enable you to create a file, such as a button bar or some kind of header, and include it into several files.Why should you use file includes? If you have a common button bar and you make a change to it, you have to change it on all the pages that have that button bar. If you have the button bar in one file and include it on several pages, then changes made to the the included file are reflected on all pages that include that file.
The Required Code:
<cfinclude template="your_file.extension">
NOTE: You cannot pass a query string at the end of the included file. (ie: your_file.extension?id=123456)
Examples:
- http://www.unisyn.com - The top and side button bar on this site is an included file. A change to one button in that site is reflected throughout the entire site.
Close