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

Replacing a template part does not prompt saving the template #35405

Closed
carolinan opened this issue Oct 6, 2021 · 7 comments
Closed

Replacing a template part does not prompt saving the template #35405

carolinan opened this issue Oct 6, 2021 · 7 comments
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Saving Related to saving functionality Needs Decision Needs a decision to be actionable or relevant [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

Using header template parts as an example:
Picture that a block theme has two header template part files that are both registered to use the header template part area.
When the default header template part is selected in the site editor, it has a toolbar option called replace. When you select replace, you can switch the template part for another.

This replacement prompts saving the first template part.
But it does not prompt saving the change to the current template. This means that on the front, the first, presumably replaced, template part still shows.
Refreshing the site editor also reverts back to displaying the first template part.

(With default template part, I mean the part who's slug is used in the markup of the template .html file in the theme.)

Did I misunderstand the purpose of the replace feature?

Step-by-step reproduction instructions

  1. Activate a theme with two registered header -or footer, template parts.
  2. Open the site editor and select the default template part
  3. Replace the current template part and see that the template part is switched in the editor.
  4. See that the save button is now enabled. Clicking the save button asks if you want to save the header template part. Save.
  5. View the front of the website to confirm which template part is showing.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 5.8.1, Gutenberg Version 11.6.0, and trunk

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

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Type] Question Questions about the design or development of the editor. [Feature] Saving Related to saving functionality [Block] Template Part Affects the Template Parts Block labels Oct 6, 2021
@Denis74F
Copy link

Denis74F commented Oct 6, 2021

Hi @carolinan ,
it happened to me too and the only solution I found is this:
1 select "list view"
2 select "header"
3 replace
4 select your template
5 now at the top you will notice the index Header selected
6 move outside the template header with the cursor (at the top you will now only see index)
7 do something in index and now save

Done!
In this way I was able to save the change.

@chthonic-ds
Copy link
Contributor

@Denis74F I feel there's still an issue here when following the steps you've provided.

If I use replace to select a new template part, I'm making a change to the template and not the template part. However, the save panel indicates changes have been made to both "Page" and "Template Part". Replacing a template part (without making additional changes to it) should be seen as a change to the template, only.

@Denis74F
Copy link

Denis74F commented Oct 6, 2021

Hi @chthonic-ds ,
you are right, however it is the only way i found to make it work, surely this problem needs to be fixed.

@carolinan
Copy link
Contributor Author

Thank you, I know how to make the template save, but users should not have to do that, it is not at all intuitive and if you are doing many iterations it is too much work.

@Denis74F
Copy link

Denis74F commented Oct 7, 2021

I agree. I wanted to help solve the problem. For users it is too difficult, in fact they probably would not succeed.

@ellenbauer
Copy link

I've been testing the Site Editor now for a while as well and it seems very confusing for me, even now.

I totally agree with Carolina's comment, it seems very difficult for users to get the entire Page Template to change when Replacing a Header or Footer Page Template Part, even though it it was one would think is happening.

@carolinan carolinan added this to 📥 To do in WordPress 5.9 Must-Haves via automation Oct 20, 2021
@carolinan carolinan added Needs Decision Needs a decision to be actionable or relevant and removed [Type] Question Questions about the design or development of the editor. labels Oct 20, 2021
@carolinan
Copy link
Contributor Author

This has been solved with #35827, closing.

WordPress 5.9 Must-Haves automation moved this from 📥 To do to ✅ Done Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Saving Related to saving functionality Needs Decision Needs a decision to be actionable or relevant [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

No branches or pull requests

4 participants