- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020
01:19 AM
11-23-2020
01:19 AM
This code below is used to call the template from /app/code/ module.
$gridHtml = $block->getLayout()->createBlock( '\Magento\Framework\View\Element\Template', 'custom_grid_new' )->setTemplate('Magento_CustomGrid::product/view/templates/grid.phtml') ->toHtml();
How to set the template from following path
/app/design/frontend/Magento/luma/Custom_Grid/templates/grid1.phtml
tried this above in above code, but is not working.
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020
09:11 AM
11-23-2020
09:11 AM
Hello @mr_bukhari
Try below code :
$gridHtml = $block->getLayout()->createBlock( '\Magento\Framework\View\Element\Template', 'custom_grid_new' )->setTemplate('Magento_CustomGrid::grid.phtml') ->toHtml();
Hope it helps !
Problem Solved ? Click on 'Kudos' & Accept as Solution !

1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020
09:11 AM
11-23-2020
09:11 AM
Hello @mr_bukhari
Try below code :
$gridHtml = $block->getLayout()->createBlock( '\Magento\Framework\View\Element\Template', 'custom_grid_new' )->setTemplate('Magento_CustomGrid::grid.phtml') ->toHtml();
Hope it helps !
Problem Solved ? Click on 'Kudos' & Accept as Solution !
