I find this something worth documenting, for the sheer scope of sources, obsolete code and articles and different semi-functional workarounds I’ve found about it. The issue? loading separate XML layout files for products in Magento 2. In my particular case all the products are Simple Products and yet I need to have different XML layouts for some of them.
So these are my options:
– Creating a new, custom, product type, extending the Simple Product
– Create custom XML handles based on either an attribute, attribute set or best; category
– Use existing XML handles
And none of them have given me a clear answer yet, so I’ll start documenting here for the sake of progress.
Creating a new product type
Creating new XML handle
https://github.com/magento/magento2/issues/102 (this is set in the Magento2 repo, but I think it’s about 1)