4

I am trying to create an custom .phtml file that will be replacing the home page. How do I call it in the CMS page? In which folder should I place the file for the callout?

0
5
{{block class="Magento\Framework\View\Element\Template" template="Magento_Cms::homepage/homepage-carousel.phtml"}}

Replacing the class (if necessary) and template with the ones you need.

5
  • Hey Ben, thanks for the answer but it's not working for me. I am using the default magento theme i.e Luma.
    – HarishK
    May 12 '16 at 17:12
  • I have placed the file in the path that you have given in the class.
    – HarishK
    May 12 '16 at 17:26
  • I presume the template class or template path is wrong. What is the template file you're trying to use? Please paste the full file path and I'll see if I can see what's wrong.
    – Ben Crook
    May 12 '16 at 18:42
  • I have placed the file in app/design/frontend/theme-frontend-luma/default/template/myelement/mypage.phtml.
    – HarishK
    May 12 '16 at 18:47
  • I think the problem is your template location, that isn't a true location as far as I'm aware. Try placing the template in app/design/frontend/**YOUR-VENDOR-NAME**/**YOUR-THEME-NAME**/Magento_Theme/templates/mypage.phtml - Replace the vendor and theme names with your own. Then update the static block to use the same path.
    – Ben Crook
    May 12 '16 at 19:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.