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

postids are included in block-template-parts & prevents FSE themes from being used across different sites. #25845

Closed
skorasaurus opened this issue Oct 5, 2020 · 1 comment
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended

Comments

@skorasaurus
Copy link
Member

skorasaurus commented Oct 5, 2020

Describe the bug
postids are included in html files within the block-template-parts when they are edited within the site-editor and then exported.
As a result, the templates are tied to a particular WordPress installation and prevents themes from being used across different websites.

To reproduce
Steps to reproduce the behavior:

  1. Create a full-site theme in Gutenberg (followed steps as of 78eb4ae).
    1a. This includes creating an index.html
    that consists of <!-- wp:template-part {"slug":"header","theme":"myfirsttheme"} /--> <!-- wp:template-part {"slug":"footer","theme":"myfirsttheme"} /-->
  2. Make edits to the theme's header and footer within the site-editor GUI.
  3. Go to wp-admin/admin.php?page=gutenberg-edit-site and export your theme's templates and overwrite them into the full-site theme that you created locally on your computer in step 1.
  4. notice that the the index.html and single.html now contain a postID field
    e.g. <!-- wp:template-part {"postId":21984,"slug":"header","theme":myfirsttheme"} /-->
  5. copy the theme's folder to a new wordpress instance; maybe you want to share your theme with a friend or the WordPress Community.
  6. within your other site, activate the theme;
  7. on your other site, wp-admin/edit.php?post_type=wp_template_part your template parts are not found there :(

Expected behavior
FSE themes would work across different WordPress installations and sites.

Editor version (please complete the following information):

  • WordPress version: 5.5.
  • the theme was created gutenberg plugin 9.1; the other site was using a newer version of gutenberg, custom built from the main branch, last commit on 2020-10-02.
@annezazu annezazu added [Block] Template Part Affects the Template Parts Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended labels Oct 26, 2020
@youknowriad
Copy link
Contributor

closed in #26268

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] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants