Home Forums Gutenberg Switch to edit mode by default


Switch to edit mode by default

  • Hello.
    I can’t find any info on the net. Do you think it’s possible to switch the block to “Edit mode” by default? When it’s in “Preview mode”, if the block is empty, as it’s empty, the customer think it’s not working…

  • You might be looking for the mode option for acf_register_block?

    It sets the block’s default display mode, either “edit” or “preview”.

    Using the supports option you can disable toggling between modes, too. So you could disable the preview mode entirely if you want.

  • Hi jnicol,
    could you please elaborate on how I would set the defualt mode to “edit” and then disable toggling between modes?
    Thank you,

  • For future reference, as I hope that this question has been resolved in the mean time:

     'mode'	=> 'edit',
     'supports' => array('mode' => false),

    When using these settings for a block, it will start in edit mode and the user won’t be able to switch.

  • Just an FYI if using ProxxiM’s solution be careful if adding this after the fact, as any blocks created and in the preview mode, will still be in preview mode and you won’t be able to change them back. For this reason it would be really nice if there was a forcemode option, as there are times you may modify an exsisting block to make it more customizable and not want it to have a preview mode anymore.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.