When working on a web site you will come across many situations where multiple pages will include the exact same code. Instead of making you duplicate your code over and over again, WebDesign allows you to include files within your document so that all similar text can come from one file on your site. This will not only allow for less code to maintain, but it also allows one file to be edited which will affect every single page in your web site. By using WebDesign Includes you can easily keep your document smaller while editing, update your entire web site by modifying one document as well reduce the amount of time it takes to fix problems with your web site.
WebDesign includes are entered within HTML comments. This will prevent the include statements from having any affect on the way your web page is displayed in a web browser.
Including files in your pageTo include a file within your document you simply use the following syntax;
<!-- wd_include file="filename"--> <!-- /wd_include file="filename"-->
You can also include a document by going to the 'Insert' menu and selecting 'WebDesign Include...'. A select file dialog will appear allowing you to select a document that you would like to include in your web page. WebDesign will automatically generate the appropriate include syntax for you.
Include statements are case sensitive and must be typed exactly as shown above. The file name is also case sensitive. Any text written inbetween the include statements will not be included in the saved file and won't show up in a web browser.
How WebDesign finds included filesIf your document has been previously saved, WebDesign will look for a folder named 'Includes' within the same directory as the saved file. If no folder is found, WebDesign will make its way up the hierarchy looking for a folder named 'Includes'. If it still can not locate the 'Includes' folder or the appropriate included file, It will look in the 'Includes' folder contained in the same folder as the WebDesign application.
If your document has not been saved, WebDesign will simply look for the included file within the 'Includes' folder contained in the same folder as the WebDesign application.
WebDesign includes are for local use only. You do not need to upload the includes folder to your FTP sever.
Updating included filesWhen you update a file that is included in another document, all documents that include that file must be updated as well. Fortunately WebDesign can automate this process for you.
You can update the included files in a single file, a folder or an entire site from within WebDesign. You can either select 'Update Includes' from the 'Insert' menu or use the Site Manager's Update Includes toolbar button.
When to use WebDesign IncludesOf course WebDesign includes can be used anywhere you like, there are some situations where using includes can be a great help to web site development. The following are great examples of where includes can be very beneficial;