EGL Development User Group

 View Only

 how to tell in code if in "design" or "preview" mode

nick leo's profile image
nick leo posted Thu November 06, 2025 09:48 AM

i would like to perform a check to see if i am in "design" or "preview" mode.

i want to do code based on which mode i am in. for example, if in design mode, show all controls so i can modify in the visual editor. when in "preview" mode, run as if in production (not showing all controls). 

Bernd van Oostrum's profile image
Bernd van Oostrum

Hi Nick Leo,

There is no specific EGL-statement that will return whether you are in "design" or "preview"-mode.

Depending on your usecase, I'd suggest you call a service in the "start"-function of your RUI, which returns a value or structure that you use to control what's being displayed.

Regards,

Bernd van Oostrum

MAINBRIDGE