include
Including the [include] tag in a template will include the contents of the specified file.
Parameters
Parameter | Description |
---|---|
file | The path to the file to be included |
raw | (optional) T/F raw=T means the file should be included unchanged, without performing any [xxx] substitutions. |
fromcache | (optional) T/F fromcache=F means a more-recent version of the file should be read from disk, instead of using the cached version in RAM. |
variable name | Passes any variable names and their values into the included file, which can then use the passed varaibles. |
Normally all file paths are relative to the local template. To ensure that the path to the file is correct, the file path can begin with "/" so that the file is referenced relative to the web server's virtual host root.
Example WebDNA code:[include file=../inc/footer.inc]
This results with the footer file being included in the current template using the relative path to the included file.
[include file=/inc/footer.inc]
This results with the footer file being included in the current template using the path to the included file
from the web server's virtual host root.
Example WebDNA code:
[include file=../inc/footer.inc&var1=a&var2=b]
This results with the footer file being included with the two variables var1 and var2 being passed into the file.
Do not use &raw=T and &fromcache=F together in the same [include]
This will error: [include file=page.inc&raw=T&fromcache=F]