template preview ad live code


i know that there is a way to output “x” when previewing a template and “y” when the template is publishing, however cant remember what it is.

Does anyone have any idea what it is?



Use a “dispatch” template, and have it compute the new template name based on the value of the sys_context parameter. If sys_context=0, this is a preview.

Of course if it a small amount of an item on the actual template and not the whole template, then something like what is mentioned here:

we use the following in our templates with great success: