REMINDER
[TM] Check editor mode
-
Hello,
I'm almost sure to remember there is a way in code in the pagebuilder to check if I'm actually in the page puilder / preview mode or not to have so very custom code while programming.
Am I dreaming ^^" ? The best would be to detect:
- Being in the page builder itself, editor mode, to add some cool custom helpers
- Being in preview mode, to let some specific helper/debugs
Thanks a lot,
Best regards, -
Hey Pierre,
you are right, there is a CSS rule you can use to display things in the pagebuilder but not in preview/real
Main use for that is when you want to be able to edit in the pagebuilder some sections that should only be displayed after an action (eg: multi steps forms).templateRow { display: none } .pagebuilder-edition .templateRow { display: block!important }
with this CSS rule, your class templateRow will be hidden in frontend (preview/published) but visible and editable in the pagebuilder
-
Hello,
Aaah thanks that's what I was thinking about.
So, I can assume that all my objects will by default inherit from that pagebuilder-edition class as long as I'm viewing them in the page builder is that it ?
Gonna give a try later in the week, thanks