What does the layout file "catalog_category_view_type_default_without_children.xml" do exactly?

From the name of the file it sounds like it's purpose is to allow you to customize the layout of categories that have no child categories of their own. I'm looking to accomplish just that, but I can't get this file to do anything.

I've placed it within my child theme folder, /app/design/frontend/my-vendor/my-theme/Magento_Catalog/layout/catalog_category_view_type_default_without_children.xml

The I tried adding a container to the layout by editing the file and adding:

    <referenceContainer name="main">            
        <container name="childtest" htmlTag="div" htmlClass="test">
          <block class="Magento\Framework\View\Element\Template" name="test.block" template="Magento_Theme::test.phtml"/>

But it doesn't work, it makes no changes to my pages that use my custom catalog_category_view.xml

I also tried removing reference blocks and that had no effect. Does "catalog_category_view_type_default_without_children.xml" not have any effect on "catalog_category_view.xml"?


I've learned that changes in "catalog_category_view_type_default_without_children.xml" apply to categories that have the "anchor" setting turned off in the CMS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.