-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Spike] Persist the BCPA home.html template through a theme switch #68427
Comments
We should also look at persisting header and footer templates on theme switch: p1664377910901159/1664205177.351119-slack-C02M88KJ684 |
Regarding of themes switching, here is some note from Developer Resources
I am putting together my research on a doc |
FYI: related, but not really something to worry about for this issue, just always good to be aware of core work. WordPress/gutenberg#25071 I think for this work, related to PA, this is the use case we want to handle:
Note these are the templates in Onur's PR |
@arthur791004, I think we can create a template without .HTML theme file right? I checked in endpoint
|
Yes, we could create any templates via the
I believe the value of
I don't think so. We're not able to change the way that how we render the “Home“ page template, so you have to know how it works. See In short, I guess the possible technical path for this one is to copy the content of the current “Home“ page template to the new one when the user switches between the themes using the “Home” page template (i.e. Note that the current “Home” page template means the template returned by Additionally, we also need to take care of the following cases:
|
@arthur791004 Can you help me understand this? Just focusing on when a user has gone thru PA flow and has the new blank canvas theme there won't be two cases. Right? There will only be one case: user switching from the BC theme which uses the home.html template to display content on the users root page. Then, on theme switech, we need to preserve the content of that template in the next theme. In the case of themes like Pendant, Cultivate, Archeo, Yuga I think we must copy the content into a template that is not called |
I tested the above cases and the
It depends. If the themes use “the latest posts” as their home page, the home page template might be “front-page.html”, “home.html” or “index.html”. Therefore, we need to copy the content from the old home page template to the new home page template. That is, we need to update the content of the new home page template with the original content. |
So we just need to preserve the content on home.html for PA flow right? |
Not exactly. We need to preserve the home page template, and it might be one of “front-page.html”, “home.html” or “index.html”. |
Correct. The reason we won't implement this in other cases is because:
|
@autumnfjeld I think what @arthur791004 meant is that while it's true that we only need to persist the content of |
Yes, that's what I mean. And we also need to consider switching back to the Blank Canvas theme, so the source of the home page template could be one of them too. We could use |
Could you link the diff to this work here? |
I made a draft diff D89996-code
What do you think @arthur791004 @fushar. We can keep the convo here since I can not reference to wpcom source code in github p1665982720077299-slack-CRWCHQGUB |
I think this is OK... if the destination theme does not have e.g. |
Yes, I agree. |
Demo from @bangank36 😃 theme-switch-demo-Screen.Capture.on.2022-10-18.at.08-49-00.mp4 |
Some theme is packed with custom patterns, but since we are just working new Blank Canvas theme with no patterns attached, I think we should not worry about that right now. How you think @autumnfjeld |
According to Ganon Sync on 10-25-2022, we decided to explore the possibility of supporting the persisting template for all other FSE-support themes, so I will dive into the solution to get the theme block pattern content and copy it into the new theme's template. Discussion is ongoing p1666672431670109-slack-CRWCHQGUB |
Description
For the PA project pbxlJb-2ki-p2 there are some user experience problems that I hope we can address and hopefully would reduce some of the issues HE are reporting. Summarized here p1664345050428549/1664268210.013819-slack-CRWCHQGUB--this summary presents an ideal project, where we could build/make the changes needed to reduce user confusion.
This spike is about persisting a template and the template content after user does a theme switch. Matias opinion is that this isn't a difficult functionality to implement. However he mentions the "front page" template here (see screenshot). I would like to explore the idea of persisting a template for any template. There may be many types of solutions.
An example of user flow
Additionally, it could be that in the actual PA flow we'd save content to home.html, then during theme switch what would happen? There are many ways to approach this, so do what is most sensible.
ToDo
Related / Info
wp_templates
WordPress/gutenberg#19260@Automattic/ganon
The text was updated successfully, but these errors were encountered: