jetpack
jetpack copied to clipboard
Untangle: show existing homepage when live-previewing another block theme
Related to:
- https://github.com/Automattic/dotcom-forge/issues/5309
This PR prevents live preview feature from always previewing the Index / Blog Home / Front Page template, when the site is part of the nav redesign.
Without this PR (in production), even if the current "Your homepage displays" setting is set to a static page, previewing a block theme will always preview the target theme's "home" template (Index / Blog Home / Front Page).
Other information:
- [x] Have you written new tests for your changes, if applicable?
- [x] Have you checked the E2E test CI results, and verified that your changes do not break them?
- [x] Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
- Enable this branch in Jetpack Beta Tester's WordPress.com Features. (Note that you must set define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php)
- Go to Settings -> Reading.
- Set the "Your homepage displays" to a static page.
- Go to Appearance -> Themes.
- Install and Live Preview a block theme.
- Verify that you are seeing the same static page (but in the target theme).
- Turn off your A8C proxy (to test existing production behavior).
- Make sure to not include the site in the early release list (
/wp-admin/options.php
, ensurewpcom_classic_early_release
is unset) - Refresh the page
- Verify that you are now seeing the theme's home template (Index / Blog Home / Front Page) (production behavior).
Appendix
"Live Preview" means this button (appears after you install the theme):
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
-
To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the
untangle/theme-preview
branch.- For
jetpack-mu-wpcom
changes, also adddefine( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true );
to yourwp-config.php
file.
- For
-
To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin untangle/theme-preview
Interested in more tips and information?
- In your local development environment, use the
jetpack rsync
command to sync your changes to a WoA dev blog. - Read more about our development workflow here: PCYsg-eg0-p2
- Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :red_circle: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged. If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.
@DustyReagan Thanks for testing!
However, it is not working for me on the "Furniture Hub" or "Furnishop" themes. And it breaks the live preview of the "Bedrock" theme.
I checked and they have a Front Page template. By definition:
The front-page.php template file is used to render your site’s front page, whether the front page displays the blog posts index (mentioned above) or a static page.
So, this is expected. This will be the behavior in JN sites as well.
And it breaks the live preview of the "Bedrock" theme. I'm unsure why.
Looks like it's related to the current p1709623282062709-slack-C02FMH4G8 🥲 it can be reproduced in production by:
- Activate Bedrock
- Set a static page as homepage
- Open Site Editor
- See blank page
I'll investigate it a bit more, but it definitely is not related to this PR.
Looks like the patterns of the previewing theme are not loaded 🤔
To close the loop, the issue is logged here:
- https://github.com/WordPress/gutenberg/issues/59634