Why is "#include" stripped from output in a Velocity script?
I'm trying to use server-side includes to include a common file on multiple pages.
If I add `<!--#include virtual="../../path/to/file//file.html" -->` to my Velocity script,
Cascade 7.8.4 outputs it as `<!-- virtual="../../path/to/file//file.html" -->`
How do I get around this?
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Rob Knight on 25 Feb, 2015 05:42 AM
OK, I found it. I needed to include a "\" in front of the `#include` because it is a file include directive in Velocity and Apache. The "\" tells Velocity to ignore it instead of processing it.
2 Posted by Ryan Griffith on 26 Feb, 2015 04:27 PM
Hi Rob,
I am glad to hear you were able to resolve the issue with the
#include
. You could also use the following to avoid the Velocity directive confusion:Where
${_EscapeTool.h}
will output the hash sign for you during transformation.I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.
Have a great day!
Ryan Griffith closed this discussion on 26 Feb, 2015 04:27 PM.