Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    [TM] Check editor mode

    Cloud CMS (Pagebuilder, Blog, Shop, Newsletters, Code Editor)
    2
    3
    183
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Pierre SULPICE
      Pierre SULPICE last edited by

      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,

      1 Reply Last reply Reply Quote 0
      • Joseph Benguira
        Joseph Benguira last edited by

        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

        1 Reply Last reply Reply Quote 1
        • Pierre SULPICE
          Pierre SULPICE last edited by

          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 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post