0

Well I am vcery new to Magento, I have a module where I have already overwritten catalog_category_view.xml and list.phtml can I use the same file with other changes in other modules if Yes how?

1 Answer 1

0

Now you can override your list.phtml at below location,

app/design/frontendVendorname/themename/Magento_Catalog/templates/product/list.phtml

Create list.phtml file and get content from core Magento Catalog template list.phtml file.

<?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>
        <referenceBlock name="category.products.list">
            <arguments>
                <argument name="template" xsi:type="string">Vendor_Module::product/list.phtml</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

You want to more information refer this link ---

https://www.rakeshjesadiya.com/how-to-override-template-phtml-files-in-magento-2/

Hope this help you

Thanks ...

1
  • I already did this I want same list.phtml in another module as well so if I try to write code in that it doesnt reflects over there
    – Jaymin
    Commented May 31, 2020 at 5:07

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.