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

Add Preview form to choose the theme to preview #5

Open
3 tasks
bobbingwide opened this issue Jan 23, 2022 · 1 comment
Open
3 tasks

Add Preview form to choose the theme to preview #5

bobbingwide opened this issue Jan 23, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request Gutenberg Required for the WordPress block editor - Gutenberg help wanted Extra attention is needed

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Jan 23, 2022

In order to initiate the caching of a theme's patterns I added logic in oik-patterns that checks preview_theme=theme and switches theme if the name of theme is valid. The patterns are loaded by the theme during init. At the end of init, if the theme is more recent than the cached patterns.json file, the updated patterns are once again cached.

A rather interesting side effect of the preview logic is you get to see the website running the chosen theme.

It would be nice to be able to enable this preview capability, giving the user the opportunity to pick the theme from any of the currently installed themes...

Requirements

  • Preview form allowing the user to choose the theme to use from a selection list
  • List of themes to come from the installed themes; possibly even non FSE themes.
  • Preview capability to be offered on a limited set of pages or anywhere on the site.
  • Form to appear somewhere on the page, regardless of the theme that's being used.

Proposed solution

  • Preview form to be a drop down select list
  • Delivered as a shortcode initially for use on the Block unit test page.
  • Hooks into ? in order to appear on the page
@bobbingwide bobbingwide added enhancement New feature or request help wanted Extra attention is needed Gutenberg Required for the WordPress block editor - Gutenberg labels Jan 23, 2022
@bobbingwide bobbingwide self-assigned this Jan 23, 2022
@bobbingwide
Copy link
Owner Author

I built the list of themes from which to select while improving the logic to load .html patterns from the patterns folder.
This can be made into a list of links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Gutenberg Required for the WordPress block editor - Gutenberg help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant