can you exclude/hide code from Preview?

I know you can use this code to hide problematic javascript etc. from active assembly:

#if(!$sys.activeAssembly)code you want to hide from active assembly#end

Is there a similar way to hide code from Preview? I have some jsp include calls that are showing up as text in Preview that I would like to hide.

Cindy

Check out: http://forum.percussion.com/showthread.php?740-Publishing-Content-different-to-Preview&highlight=sys.context

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)

I just use something like #if($sys.assemblyItem.context == 0) to match preview or #if($sys.assemblyItem.context > 0) to match anything else.

I tried applying on this into my templates and nothing worked when I published the page to my server. Where should I be inserting this code?

to show only in preview

#if($sys.assemblyItem.context == 0)
#field(“displaytitle”)
#end

to show only in publish

#if($sys.assemblyItem.context > 0)
#field(“displaytitle”)
#end

Watch out for case sensitivity.

Exactly what I needed, and quick too! Thanks all.

Cindy