;TL/DR; Can we migrate block patterns with all required styling and media dependencies to a child theme?
The detail…
We created patterns in the TT3 theme and then decided changes in Style Variations were desired, or rather a copy/edit of a json file in the styles folder. It was clear that a Child theme was required for this and ongoing customizations.
So I used the standard WP Export which looks like it will do the job. I created a Child theme and switched to it.
The custom patterns are not in the Child theme when that is activated. My guess is that the patterns are in the database, keyed to the parent name. And I probably need an enqueue hook that directs the Child to use the Parent key when referencing patterns.
Then again, if a child theme changes beyond basics, we don’t want it to use parent patterns. So, this is where I figured the Export would help.
But while it looks from the Export text that patterns might be included, the text for Import doesn’t give the same impression. It makes sense that a block structure can include blocks that are unique to an environment, not available in a new one for import. A pattern can rely on style variations and media that aren’t available in a new environment, so why bother to import them?
That makes me think I’m just using the wrong tool. The classic Export/Import does a lot more than in the past but maybe this is not one of the features.
That leaves the question, what is the right tool to export and import blocks, patterns, template parts, and templates … in the same environment? … Or at least from parent theme to child?
Apparently now I need to create a separate environment to test what was originally just another website using blocks. The challenge will be to recreate a TT3 child, Export patterns from parent, Import to child, and see what’s missing …and find other tools to test their efficacy.
( Gawd, I love all of this technology that makes our lives easier and saves us so much time. :rolling_eyes: )
The real question is … Where is current documentation about this area so that I can read about how to do this and what to expect? I understand this is FOSS, docs are voluntary and often need to catch up. (I’ve contributed to the docs.) Maybe I missed detail. Maybe there are videos. Maybe WPMU DEV has blogged about this in an oft-labeled “Ultimate Guide”.
As much as seeking answers, I want to know where the answers are or should be. Let’s note here where to fish rather than tossing fish around. ( Ref the “Teach a man to fish” proverb. )
What confounds me is that Gutenberg is evolving, especially with changes just in WP 6.3, and the docs aren’t keeping up. I’ll take that up with the team there. For now, I’m asking here. :smirk:
Thank You!