Discovering Preview Context in Movable Type Entry Templates

| No Comments | No TrackBacks |
Recently someone on the Movable Type Open Source mailing list asked if there was an easy way to determine if an entry was being looked at in Movable Type's "preview" mode as opposed to being published "for real".  This might be useful to hide (for example) statistics tracking code, popups, automatic redirection scripts etc.
Jay Allen of Endevver came up with this undocumented gem:

 <mt:If name="preview_template">...</mt:if>

No TrackBacks

TrackBack URL:

Leave a comment