[#include path] or [#include path options]
Where:
- path: The path of the file to include; must be an expression evaluates to a string
-
options: One
or more of these:
encoding=encoding,
parse=parse
- encoding: Expression evaluates to string
- parse: Expression evaluates to boolean (also accepts a few string values for backward compatibility)
This directive is kind of deprecated. That said, we don't plan to remove it, but in almost all use cases you should use the import directive or the embed directive instead.
This directive is the same as the embed directive, except that the included template will use the namespace of the including template. That is, variables (like macros) created in the including template will be visible for the included template, and also the other way around. For example, assume /common/copyright.ftl contains:
| |||
Then this:
| |||
will output this:
| |||
So here multiple templates are using a common namespace, potentially clobbering the variables of each other. This can easily cause maintenance headaches, so use it only if you are sure you need this feature. If you just want to share common variables and macros with other templates, you should use the import directive.


