I'm trying to add containers/blocks to a newly created page layout. However, they do not show up in the DOM at all:
vendor/my/module/view/frontend/layouts.xml:
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
<layout id="new-layout">
<label translate="true">New layout</label>
</layout>
</page_layouts>
I can select this layout. That works.
vendor/my/module/view/frontend/page_layout/new-layout.xml:
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<update handle="1column"/>
<referenceContainer name="page.wrapper">
<container name="cake" label="CAKE" htmlTag="div" htmlClass="cake" before="-"/>
</referenceContainer>
</layout>
That container doesn't show up. So I try adding a block..
vendor/my/module/view/frontend/layout/default.xml:
<?xml version="1.0"?>
<page layout="new-layout" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="cake">
<block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs" template="Magento_Theme::html/breadcrumbs.phtml"/>
</referenceContainer>
</body>
</page>
Nothing of all this shows up in the DOM..
Edit:
The problem was that the breadcrumb referenceBlock was set to remove="true" for all CMS pages. However, for this new layout I want to undo this with remove="false". This doesn't seem to work. I also tried re-adding the block:
<block class="Magento\Theme\Block\Html\Breadcrumbs" name="test.breadcrumbs"/>
But this doesn't work. It loads the template but there are no $crumbs found so they aren't loaded. If I remove the 'remove="true"' the breadcrumbs DO show.. I want it just to show for this layout. Why don't my 2 suggested solutions work?