where the following is used (note that the default sys_context of 0 = preview, 301 = publish) #if ($rx.asmhelper.getSingleParamValue($sys.params, “sys_context”) == “301”)##
publish only code here
#end##
i have used the following as well: #if(($rx.asmhelper.getSingleParamValue($sys.params,‘sys_itemfilter’)==“public”))##
public only code here
#end##
For information about the context see pg 321 in the RX Implementation Guide (6.7)