Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Megamenu block no longer sees template parts #4

Open
tomfinitely opened this issue Nov 28, 2024 · 4 comments
Open

Megamenu block no longer sees template parts #4

tomfinitely opened this issue Nov 28, 2024 · 4 comments
Labels
Bug Something isn't working

Comments

@tomfinitely
Copy link

tomfinitely commented Nov 28, 2024

As of 6.7.1 (haven't tested lower versions) the Megamenu block doesn't see relevant template parts including any that have already been associated with the block.

Note: I don't see any console errors, and also haven't had sufficient opportunity to disable plugins and/or enable debugging output.

EDIT: the only logged error that I can find that might be indicative of the issue is:

[28-Nov-2024 23:04:17 UTC] PHP Warning: Attempt to read property "ID" on null in /Users/me/Local Sites/mysite/app/public/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php on line 167

@ndiego
Copy link
Owner

ndiego commented Dec 8, 2024

Thanks for reporting @tomfinitely. I just tested in 6.7.1, with and without Gutenberg active, and I am seeing the menu template parts in the block. Any additional info you can share?

image

@ndiego ndiego added the Bug Something isn't working label Dec 8, 2024
@bmx269
Copy link
Contributor

bmx269 commented Dec 13, 2024

I too am finding a strange error here. I create templates for menus, and unless I add the template to the menu category in the theme.json, they get put into the General category, but only after I save the changes to the theme with Create Block Theme.

I have not had time to debug.

To keep that menu working on deploy, I have to add them manually like this example:

theme.json

"templateParts": [
		{
			"area": "header",
			"name": "header",
			"title": "Header"
		},
		{
			"area": "footer",
			"name": "footer",
			"title": "Footer"
		},
		{
			"area": "menu",
			"name": "about-mega-menu",
			"title": "About Mega Menu"
		}
	],

@ndiego
Copy link
Owner

ndiego commented Dec 13, 2024

I too am finding a strange error here. I create templates for menus, and unless I add the template to the menu category in the theme.json, they get put into the General category, but only after I save the changes to the theme with Create Block Theme.

The Create Block Theme plugin does not support custom template part areas (in this case, menu), which is why they end up in the General category. The manual step is expected.

@bmx269
Copy link
Contributor

bmx269 commented Dec 13, 2024

Good to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants