Reply to topic
Including .cfm templates in .shtml files
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
If you are using .shtml files you can do a server side include of CF templates.

Use the #exec directive instead of the #include directive in your .shtml file.

<!-- #exec CGI="/cftemplate.cfm" -->

Be sure to use an absolute pathway, "/template.cfm" instead of a relative pathway "../directory/template.cfm", as a relative pathway will not work.
Included Files
jamie
HostMySite Sales Rep
HostMySite Sales Rep

Joined: 19 Mar 2004
Posts: 766
Location: Newark, De
Reply with quote
Would this work on other included file types, such as .cgi Question
steve
HostMySite Developer

Joined: 02 Mar 2004
Posts: 30
Reply with quote
You can include pages in a cgi-bin directory such as Perl and CGI in the same manner:

<!--#exec cgi="/cgi-bin/script.pl" -->

<!--#exec cgi="/cgi-bin/script.cgi" -->
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
Something that came up as a problem when doing this for us. Every call made by the .shtml file using exec will act as a new call to CF. We we're getting a ton of client variables created in the db because each include acts like a http request.

Since there is no way for a cookie to be returned and set by the calling .shtml file each request has a new cfid and cftoken. Just something to look out for.
Including .cfm templates in .shtml files
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic