0

I have a theme installed on my Magento V2.2.3 site and now i would like to change the category page design with requirements

  • new custom fields for category
  • option on each category if this category will be visible with new design or not
  • if yes, then i need category custom fields which will have slider image and text box which i need to put above product list.

Can someone tell how i can achieve this

Thank you in advance!

1 Answer 1

0

You could try adding and/or overriding containers and blocks from the catalog_category_view.xml file which is located at:

vendor\magento\module-catalog\view\frontend\layout\catalog_category_view.xml

To add custom attributes, you might want to look to put a block before category.products in a custom phtml file.

Example:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
       <referenceContainer name="content">
          <block class="MyVendor\MyModule\Block\Rewrite\Category\View" name="custom.attributes" template="MyVendor_MyModule::category/products.phtml" before="category.products">
       </referenceContainer>
    </body>
</page>
1
  • I'm writing a module for this, can you please tell me which files i need to override category page
    – John
    Jun 16, 2020 at 15:34

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.