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: https://www.movabletips.com/cgi-bin/mt/mt-tb.cgi/75

Leave a comment


Movable Type Help?

"Can my Movable Type issue or project be taken care of by a professional?" Yes It Can Be! Contact YesItCan.be
Powered by Movable Type 5.2.7