template preview ad live code

Hello,

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?

Thanks

Nicholas

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:
http://forum.percussion.com/showthread.php?t=740&highlight=sys_context

we use the following in our templates with great success:


#if($rx.asmhelper.getSingleParamValue($sys.params,'sys_itemfilter')=="public")