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
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 ...
-
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– JayminCommented May 31, 2020 at 5:07