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

Template locked: Block style variation options show in the block sidebar #69238

Open
3 of 6 tasks
carolinan opened this issue Feb 19, 2025 · 1 comment · May be fixed by #69260
Open
3 of 6 tasks

Template locked: Block style variation options show in the block sidebar #69238

carolinan opened this issue Feb 19, 2025 · 1 comment · May be fixed by #69260
Labels
[Feature] Document Outline An option that outlines content based on a title and headings used in the post/page [Feature] Templates API Related to API powering block template functionality in the Site Editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

carolinan commented Feb 19, 2025

Description

When you edit a page in the block editor and enable "Show template", some template blocks can be seen and selected from the List View. Because they are in the template, they have no settings or styling options.
This is working as intended.

But when you open the Document Outline, it lists heading blocks that are in the template. When you click on the item in the Document Outline, the block is selected.
When the block is selected, it shows the block style variations. The style can be selected and previewed, but it can not be saved.

I don't think the style variations are meant to be visible in the block settings sidebar: I make this conclusion since all other options are hidden.

Step-by-step reproduction instructions

Activate Gutenberg trunk.
Activate Twenty Twenty-Five.
Open the page template in the Site Editor.
Add a heading block anywhere on the template, save.
Create a new page.
With "Show template" enabled, open the Document Outline.
Confirm that the heading that you added to the template is listed: Click on it.
Confirm that the style variations for the heading block are showing, and that you can apply it but not save it.

Screenshots, screen recording, code snippet

In the screenshot I am editing a page, I have selected the heading by clicking on it in the Document Outline, and then selected the annotation style.

The heading style variation options are showing when the heading is selected

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

This can possibly be solved in #69073 by removing the block selection from the document outline. I opened a separate issue for it because I think it should be solved no matter if 69073 is included in 6.8 or not.
I have not looked into how the other styling options are hidden: I suspect that block style variations was perhaps forgotten when the other options were hidden.

@carolinan carolinan added [Feature] Document Outline An option that outlines content based on a title and headings used in the post/page [Feature] Templates API Related to API powering block template functionality in the Site Editor [Type] Bug An existing feature does not function as intended labels Feb 19, 2025
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 20, 2025
@yogeshbhutkar
Copy link
Contributor

After researching, I found that other options appear only when the editing mode is set to default. So, I created a PR applying the same condition to fix the bug, and it works as expected.

Ref.

if ( blockEditingMode !== 'default' ) {
return null;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Outline An option that outlines content based on a title and headings used in the post/page [Feature] Templates API Related to API powering block template functionality in the Site Editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging a pull request may close this issue.

2 participants