Question

How to call new.phtml file in the home page admin Magento 2.2.6 version?

Please check my screenshot link here http://prntscr.com/lapiu7.

And also check my theme default.xml code.

<referenceBlock name="category.products.list"   >
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Magento_Catalog::product/new.phtml</argument>
    </action>

Then after that, I put the code in my cms home page admin.

{{block class="Magento\Framework\View\Element\Template" name="new_file" template="Magento_Catalog::product/new.phtml"}}

http://prntscr.com/lapk4g

But it's not working.

Please let me know how to implement custom product slider in Magento 2.2.6

http://prntscr.com/lazzuu

Was it helpful?

Solution

If you want to show New Product with default phtml, You can call below code to home page.

{{widget type="Magento\Catalog\Block\Product\Widget\NewWidget" display_type="new_products" show_pager="0" products_count="10" template="product/widget/new/content/new_list.phtml"}}

Above code will show new products. If you want to change design, you need to copy above phtml to your custom theme with following path.

app/design/frontend/Cloudways/m2-theme/Magento_Catalog/templates/product/widget/new/content/new_list.phtml

Please make sure there are new product available in admin with applicable date

IF found suitable accept and Up-vote as a token of appreciation

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top