Skip to content

Conversation

@StevenDufresne
Copy link
Contributor

@StevenDufresne StevenDufresne commented Jul 20, 2022

This PR surfaces registered patterns (using WP_Block_Type_Registry). It leverages wp-themes.com and this screenshot block.

Related to: #83

How does It work?

  • Queries https://wp-themes.com/{theme_slug}?rest_route=/wporg-patterns/v1/patterns for registered patterns.
  • Loads a ScreenShot block which loads a screenshot of the pattern embedded in the theme via wp-themes.com (See first screenshot)
  • When users click on ScreenShot, loads pattern in wp-themes.com preview. (See second screenshot)

What's still to do?

Continually improve pattern previews

The screenshot is a snap of a live page, visible at https://wp-themes.com/{theme_slug}?page_id=2&pattern_name={pattern_name}&preview. I believe this is the best approach because it's the closest experience to what a user would see using the pattern. However, there are some awkward layouts that are somewhat related to the code. So if some patterns are not rendering perfectly, we can make some changes there but that should be iterative. We won't get that correct right away.

Improve Theme Page interactions

We could add more affordance to the ScreenShot block for clicking, and better error handling, but I believe that block is currently good enough.

Screenshots

In-theme preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant