Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Rough draft of patternception POC #129

Merged
merged 3 commits into from
Apr 12, 2023
Merged

Rough draft of patternception POC #129

merged 3 commits into from
Apr 12, 2023

Conversation

johnstonphilip
Copy link
Contributor

This branch is a POC of how patterns-inside-patterns could work:

How to test

  1. Whenever you want to use a pattern inside another pattern, use the PM:Pattern block:

Screen Shot 2023-03-27 at 4 33 48 PM

2. Type the name of the pattern you wish to use (this should instead be a list of patterns in the theme to choose from)

Screen Shot 2023-03-27 at 4 35 04 PM

3. When you save the pattern, the block code saved to the file will use the

Screen Shot 2023-03-27 at 4 36 15 PM

4. When you load up that pattern again, it will be using the PM block.

To do:

  • Make the "Edit This Pattern" button save the current pattern, then open the pattern in question.

Screen Shot 2023-03-27 at 4 38 20 PM

- Possibly, make our pattern block show a preview of the blocks inside that pattern (but they should **NOT be editable**)

@johnstonphilip
Copy link
Contributor Author

johnstonphilip commented Mar 27, 2023

To match core, the value saved to the slug attribute would have to match the registered slug for the pattern.

@johnstonphilip
Copy link
Contributor Author

Note: The reason we can't just use core's pattern block is because upon save, it inserts the pattern, wiping out any use of the core pattern block.

@johnstonphilip johnstonphilip changed the title Rough draft of patternception POC [DO NOT MERGE] Rough draft of patternception POC Mar 29, 2023
@kienstra kienstra marked this pull request as ready for review April 11, 2023 20:47
@kienstra
Copy link
Contributor

Hi @mike-day and @mikemcalister,
Is it alright to merge this PR?

Patternception is a work in progress, but we can always deactivate it by removing a few lines of code.

@kienstra kienstra changed the title [DO NOT MERGE] Rough draft of patternception POC Rough draft of patternception POC Apr 11, 2023
@kienstra kienstra merged commit 88480bf into main Apr 12, 2023
@kienstra kienstra deleted the try/patternception branch April 12, 2023 16:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants