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

Pattern consist of multiple patterns working fine but failed to display or load in patterns dashboard #38952

Closed
randhirexpresstech opened this issue Feb 21, 2022 · 8 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@randhirexpresstech
Copy link
Contributor

Description

Register a pattern consist of multiple patterns doesn't display or load in patterns dashboard. However, insertion of same pattern in pages is working fine i.e. getting all blocks
Please check screen-cast pattern-consist-of-multiple-patterns-working-fine-but-failed-to-display-or-load-in-patterns-dashboard

Step-by-step reproduction instructions

  1. Download and install Twenty Twenty-Two theme
  2. Open theme folder in any code editor and go to inc folder >block-patterns.php file
  3. Register a block pattern which consist of multiple patterns at the end of all registered patterns as shown in screen-cast
  4. Go to admin dashboard > pages> add new page > open block inserter > patterns > explore
  5. Check the new registered pattern. It will display the area of new registered pattern but not display the content
  6. Inset the pattern and check if all blocks inserted or not
  7. Publish the page

Screenshots, screen recording, code snippet

Please check screen-cast pattern-consist-of-multiple-patterns-working-fine-but-failed-to-display-or-load-in-patterns-dashboard

Environment info

WordPress version 5.9
Twenty Twenty-Two theme version 1.0
Gutenberg plugin version 12.6.0

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

@annezazu
Copy link
Contributor

Register a block pattern which consist of multiple patterns at the end of all registered patterns as shown in screen-cast

Can you share more about why you're trying to do this? I imagine this is expected to not work since the pattern directory is only meant to show individual patterns :)

@annezazu annezazu added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Help Request Help with setup, implementation, or "How do I?" questions. labels Feb 21, 2022
@randhirexpresstech
Copy link
Contributor Author

I am trying to create meaningful page patterns for admin to use like home-page, about-page etc with the help of multiple patterns so that admin can able to create pages for website using single pattern (which consist of multiple patterns) on single click. These patterns are working fine too except issue of loading pattern in pattern popup
I am trying to reuse registered patterns or creating nested patterns to avoid repetition of code and provide beautiful designs to admin for use.
A group of small individual patterns can create a beautiful design.

@annezazu
Copy link
Contributor

Ah ha gotcha. Full page patterns are still being explored currently: #38787 You can see more around building with patterns in general here: #38529

I'm not quite sure if what you're describing is supported yet/a best practice, which is likely why you're running into this problem. What happens if, when registering, in the content you copy/paste the full HTML rather than referencing the patterns themselves? I might lean on that method for now. I'll keep this open in case others have any thoughts though as I would image this could be something folks would want to be able to lean on in the future.

@randhirexpresstech
Copy link
Contributor Author

randhirexpresstech commented Feb 22, 2022

If, we registering, in the content copy/paste the full HTML rather than referencing the patterns there then it's just a repetition of the same code and in future, if we will have to correct or change something in patterns then we will have to do this in multiple places which is not a good code practice.
I think, reusability of patterns is the best, optimized and fastest way to implement this kind of feature.

@tellthemachines
Copy link
Contributor

Hi @randhirexpresstech ! Full-page patterns should now be possible with #40034. Can you confirm so we can close this issue?

@randhirexpresstech
Copy link
Contributor Author

Hi @randhirexpresstech ! Full-page patterns should now be possible with #40034. Can you confirm so we can close this issue?

Thanks @tellthemachines. Issue still exists, pattern consist of multiple patterns doesn't display or load in patterns dashboard. Please check screen-cast
Theme: Twenty Twenty-Two
Theme Version: 1.2
Wordpress Version: 6.0.3

@ntsekouras
Copy link
Contributor

Hey @randhirexpresstech! Is this still an issue after: #44784?

@randhirexpresstech
Copy link
Contributor Author

Thanks @ntsekouras. Issue has been resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

4 participants