Support

Account

Home Forums Gutenberg Edit mode doesn't work

Solving

Edit mode doesn't work

  • Hello.

    I can not enable edit mode on any of my blocks. I have the mode set to edit in the block.json file but when I add the block in the site editor it is always set to preview mode for some reason. Anyone have any idea on what’s going on?

  • Same here.

    {
    	"apiVersion": 2,
    	"name": "acf/home-solutions",
    	"title": "Lösungen (Home)",
    	"description": "Der Lösungen Bereich - nur für die Startseite",
    	"category": "xxx",
    	"icon": "star-filled",
    	"keywords": ["home", "lösung"],
    	"acf": {
    		"mode": "edit",
    		"renderTemplate": "home-solutions.php"
    	},
    	"supports": {
    		"align": false
    	},
    	"style": ["file:./style/home-solutions.css"]
    }
    

    The edit mode shows preview and the toggle icon to edit.

  • Hey there,

    Setting “mode: edit” in your block will only set the default mode that should be used for the block. If you then want to disable the toggle, you need to set “supports: mode: false” in your block.json too.

    
    {
    	"apiVersion": 2,
    	"name": "acf/home-solutions",
    	"title": "Lösungen (Home)",
    	"description": "Der Lösungen Bereich - nur für die Startseite",
    	"category": "xxx",
    	"icon": "star-filled",
    	"keywords": ["home", "lösung"],
    	"acf": {
    		"mode": "edit",
    		"renderTemplate": "home-solutions.php"
    	},
    	"supports": {
    		"align": false,
    		"mode": false,
    	},
    	"style": ["file:./style/home-solutions.css"]
    }
    
  • Hi there!

    I have the similar issue –
    In the mode of editing template parts there is no button to switch the editing mode – all the fields are displayed in the sidebar and with a large number of them it is very inconvenient. I tried all combinations of mode and supports – no reaction. At the same time, if the block is inserted on a normal page, not the template, everything works as expected.

    https://prnt.sc/RnKl8a3dQa90

    {
    	"name": "acf/podcasts-categories",
    	"title": "Podcasts Categories",
    	"description": "A list of podcasts categories",
    	"style": [
    		"file:../../../assets/css/blocks/podcasts-categories/podcasts-categories.css"
    	],
    	"viewScript": "lbl-podcasts-categories-block",
    	"category": "lbl-blocks",
    	"icon": "category",
    	"keywords": [ "podcasts", "category", "post" ],
    	"acf": {
    		"mode": "auto",
    		"renderTemplate": "podcasts-categories.php"
    	},
    	"align": "full",
    	"supports": {
    		"align": true,
    		"anchor": true,
    		"mode": true,
    		"alignContent": false,
    		"spacing": {
    			"margin": true
    		}
    	}
    }
  • Same issue as Reichbaum. My block works as expected if I add it to a page (it follows the settings for “acf: mode” and “supports: mode”), but if it’s added to a template part, those settings don’t do anything anymore. The edit mode is locked and can’t be toggled, and the fields always show in the sidebar.

    If anyone knows how, I would love to be able to move the fields out of the sidebar.

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

You must be logged in to reply to this topic.