Include Files and Server Side Code Support
- In this document:
- Overview
- Supported Languages
- Special Notes
Overview
TypeRoom Lite provides the ability to seamlessly integrate with your existing server-side includes using just a few lines of code.
To enable this, just add the following comments at the very top and very bottom of your include files:
//Your Code Here
<!-- /tr_include -->
Upon publishing, TypeRoom Lite will replace whatever is between these two tags with the include statement written in the language you specify. (TypeRoom Lite supports php, asp, cfml and shtml).
Here is an example of this in action:

Below is a menu being included using PHP...

To enable TypeRoom Lite include integration, we’ve added the code shown in red.
Now TypeRoom will see the following code:
<html> <body> ... <!-- tr_include php:"includes/menu.inc.php" --> <ul> <li><a href=#">Home</a></li> <li><a href=#">About</a></li> <li><a href=#">Services</a></li> <li><a href=#">Contact</a></li> <li>(Output from your php snippet)</li> </ul> <!-- /tr_include --> ... </body> </html> </div>
It will publish the following:
<html> <body> ... <?php include "includes/menu.inc.php"; ?> ... </body> </html>
Supported Languages
PHP
Markup: <!-- tr_include php:"includes/menu.inc.php" --> <!-- /tr_include -->
Output: <?php include "includes/menu.inc.php"; ?>
SHTML
Markup: <!-- tr_include php:"includes/menu.inc.shtml" --> <!-- /tr_include -->
Output: <!--#include virtual="includes/menu.inc.shtml" -->
ASP
Markup: <!-- tr_include asp:"includes/menu.inc.asp" --> <!-- /tr_include -->
Output: <!--#include file="includes/menu.inc.asp"-->
CFML
Markup: <!-- tr_include cfml:"includes/menu.inc.cfml" --> <!-- /tr_include -->
Output: <cfinclude template="includes/menu.inc.cfml">
Special Notes
While TypeRoom Lite can now preserve your include code, it can not edit any content within the include files. Any changes made to content between <--tr_include --> and
<-- /tr_include --> will not be published back to the server. It is recommended that this feature is used in conjunction with editable regions.
It also important to know that any server-side code that is written directly in the file you are editing will be lost upon publish, expect for the include call. It is recommended that any dynamic code be included from a separate document so TypeRoom does not overwrite it when publishing.
Question/Comments
Got a question or some feedback? You can always send us an email at . We look forward to hearing from you!
