Detecting whether code is being run in Dashboard
Permalink
Hi,
I made a pretty hefty template modification to the Auto-nav block - and now when an instance of which gets added to the scrapbook, it makes everything explode in fiery shrapnel if you view the scrapbook in the Concrete5 back-end.
So, what I've been looking for is an easy way of detecting whether my code is being run/viewed in the dashboard/scrapbook - so I could make a conditional exception in this case (something similar to isEditMode in the frontend)
Does something like this exist? After much searching and testing I have not been able to find a way to detect whether my code is being rendered in the scrapbook vs. the frontend... Any ideas out there? :)
Thanks!
Psst
I made a pretty hefty template modification to the Auto-nav block - and now when an instance of which gets added to the scrapbook, it makes everything explode in fiery shrapnel if you view the scrapbook in the Concrete5 back-end.
So, what I've been looking for is an easy way of detecting whether my code is being run/viewed in the dashboard/scrapbook - so I could make a conditional exception in this case (something similar to isEditMode in the frontend)
Does something like this exist? After much searching and testing I have not been able to find a way to detect whether my code is being rendered in the scrapbook vs. the frontend... Any ideas out there? :)
Thanks!
Psst
Note that it's weird your block blows up in the global scrapbook -- that might be indicative of another problem. Is it a style thing (like CSS is interfering), or a javascript thing (functionality is broken)?