You can use the include directive to insert another Freemarker template file in the template.
Grammar:
<#include path/> or < #include path options/>
Description
- Path: Paths to include files. You can use relative paths and absolute paths. Usually use/(slash) to split the path component.
- The supported options are:
Encoding: An expression that counts as a string. The encoding by which the included file inherits from the contained file. (Iso-8859-2, UTF-8, GB2312)
Parse: An expression that counts as a Boolean value. The default is true. If it is true, then the included files will be interpreted as FTL, or the entire file will be treated as simple text. (That is, the freemarker structure is not found in it)
Example:
<#include "FOOLTER.FTL"/>
Note:
- The output format of the included template is inserted at the location where the include tag appears.
- The contained file and the template that contains it share the variable as if it were copied and pasted in.
- This directive cannot be confused with the include of a JSP (servlet) because it does not involve the servlet container, but only the other Freemarker template, and cannot "leave" the Freemarker.
Freemarker include directive (3.3)