Re: current context in edit mode
Luke Brannon <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <CAP9jDSmyFSpcqGxXyeR1daKBYNqjRqBQuxN6Sr+NVusex5LA5w@mail.gmail.com> |
Dan, Thank you very much! This did the trick. Regards, Luke On Thu, Jul 18, 2013 at 4:44 PM, Dan Jacka <[email protected]> wrote: > Hi Luke, > > > On 19/07/13 10:46, Luke Brannon wrote: > >> In Plone 4.x is there a programmatic way to determine if the current >> context is in edit mode? I'm attempting to write a python expression to >> prevent a javascript from loading when the AT content type is being >> edited. >> >> Regards, >> >> Luke >> > > The plone_context_state view in plone.app.layout has the is_view_template > method, which might be what you want. > > Try it by adding the following condition to your JavaScript file in > portal_javascripts: > > python:context.**restrictedTraverse('@@plone_**context_state').is_view_** > template() > > HTH, > Dan > ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Plone-developers mailing list Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/plone-developers