0

I want my level 0 category to have a different layout from level 1,2...How can I do this by code or by admin page?

Thanks!

0

You can add below code at admin category settings under "Layout Update XML":

<referenceContainer name="content">
   <referenceBlock name="category.products.list">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">YourPackage_YourModule::path/to/file.phtml</argument>
    </action>
   </referenceBlock>
</referenceContainer>

if you are simply trying in any xml file then you can update by below code:

<referenceBlock name="category.products.list">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">YourPackage_YourModule::path/to/file.phtml</argument>
    </action>
</referenceBlock>

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.