What’s the best way to enable Server Side Includes in Rhythmyx? We’d like to be able to make emergency changes sitewide by changing an SSI file, without having to republish everything. We’d previously been using SSI for headers and footers, which of course can go into Global Templates, but it would be nice to have an alternative. My attempts today got “assembly errors”, so a code example/snippet would be appreciated.
I’m afraid I don’t have any code snippets, but here’s the general idea.
You need 3 pieces:
- A Snippet that is the text to be included
- A “Page” template that renders just this snippet
- A Snippet that renders the #include statement.
You need at least 2 different templates (the page template has to be published), but you can use Velocity macros to keep the amount of code down to a minimum.
The logic in your “snippet” template will render the #include when sys_context > 0, and the full text when sys_context = 0.
I realize this is a bit difficult to describe without a concrete example.
In trying to accomplish SSI, we have this line in the template
LT!-- #include virtual="alert/alert.htm" --GT
However, Rhythmyx complains on “virtual” and page assembly fails. Is there a way to escape this?
yep you can escape velocity directives with a \
<!-- #include virtual=“alert/alert.htm” -->