|
Including Templates within a TemplateIf you're using a <include name> The <include "foo-templates/template-to-include.html"> The output from the included template is inserted at the point where the
Since Other files can be included as well. If you need to include a file that shouldn't/doesn't need to be compiled by the FreeMarker parser, these can be included as follows: <include "foo-files/file-to-include.inc"; parse="n"> There are two optional attributes that can be expressed after a semicolon. You can set the include to treat the file as a plain file, i.e. unparsed. You can also set the encoding of the file. If this is not set, the included file is assumed to be stored in the same encoding as the enclosing template. This, of course, is the usual situation and most people will have little reason to use these attributes. <include "included.txt" ; parse="n" encoding="ISO-8859-5"> The code above says to include the file "included.txt", to treat it as a plain file, and that it is encoded in the "ISO-8859-5" character encoding. Note that the file to be included need not be a literal string. It could also be a variable or other expression that resolves to the filename. |
|