1

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"/>
        </container>        
    </referenceContainer>

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"?

2 Answers 2

3

The catalog_category_view_type_default_without_children.xml file is used for those category which does not have any children category and has disabled the Anchor.

enter image description here

I hope given information will be useful for you!

2
  • i was also confused about this layout how this and where this using ,thanks. you clear my doubt as well. Commented Jul 1, 2021 at 9:40
  • thanks & Welcome bro Commented Jul 1, 2021 at 9:42
1

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.

1
  • And also do not have any children
    – Gaz Smith
    Commented Jul 1, 2021 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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