You would have to place the file in the /pattern directory as described in the instructions you linked, not in /parts. And then it should have the extension .php, not .html.
Thread Starter
en_fer
(@n_feragnoli)
@threadi thanks!
I really did miss that!
yet this brings me to another point… how did I miss that..?
while it is obvious that a love of work has gone, in the last months, towards updating/reorganizing the docs, some of the features are – here and there – not clearly communicated.
the doc clearly says:
Now let’s add the code that you copied from the previous section into the /patterns/hero.php file in your theme:
but it does so only in that paragraph. Coming from classic theme development everything is .php for me. but in the guide docs covering block themes development a great deal of emphasis goes into stressing how templates and templates parts are now just .html files.
It is perfectly obvious why pattern files should be php files but that detail is really given for granted, to an external eye.
But I guess that goes hand-in-hand with the whole lack of clarity about the template/template-part/pattern/block architecture.
Or, at least, the lack of clarity in the way that structure is reflected in the Site Editor (template parts show up in the Patterns page, share the same categories, are not indicated/specified on their own… ; custom blocks available in the Post Editor might not be accessible in the Site Editor…)
Thanks again
No one would reasonably argue that the WP docs are perfectly clear. It’s exceedingly difficult to write docs that are clearly understood by such a wide range of skill levels. And it’s virtually all accomplished by volunteers! The docs team welcomes any contribution to improve the docs. If you’re willing, look at the “Want to get involved?” section of their “Make” page. You may contribute anything from raising an issue on GitHub to getting fully onboard the docs team. Thanks.
Thread Starter
en_fer
(@n_feragnoli)
@bcworkz yes, sorry, I apologize. I didn’t mean to nag about the docs, although I understand it might have sounded as such.
I’m glad I could help you with this. If the question has been clarified for you, you are welcome to set the topic to solved.
en_fer — No need for an apology, I did not perceive it as nagging, more like constructive criticism. I often take opportunities like this to encourage greater participation in the WP community 🙂