0

This question already has an answer here:

I created a file in phtml and would like to call it in a static block.

I created the cms folder inside the theme.

My route is different and is not a duplicate

/public_html/app/design/frontend/Magento/luma/cms/file.phtml

How can I recall this file in a static block?

Thanks

marked as duplicate by Siarhey Uchukhlebau, Manoj Deswal, Prince Patel, Piyush, Manashvi Birla Nov 24 '17 at 6:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Is not a duplicate my route is different – Alessandro Nov 23 '17 at 14:28
  • Is not a duplicate my route is different. Please I tried with the other gruff but it did not work – Alessandro Nov 23 '17 at 14:53
2

You need to create custom module with an Block In folder Custom_Module_Folder/view/frontend/view/test.phtml

And in your block you update the layout

    <referenceContainer name="content">
        <block class="YOUR BLOCK CLASS"
         name="test"
         template="test.phtml" after="-" 
        />
    </referenceContainer>
  • Does not work. I created /public_html/app/design/frontend/Magento/luma/Magento_Cms/templates/cms/file.php and in the static block I entered {{block type = "core / template" template = "Magento_Cms: cms / file.phtml"}} but nothing. – Alessandro Nov 23 '17 at 15:38
  • You can see in your logs? are you sure that you use Magento/luma as theme? – Mohamed El Mrabet Nov 23 '17 at 15:51
  • How can i see the logs? However, I use Luma as a theme with some modifications made by me. My site is avalonitalia.com – Alessandro Nov 23 '17 at 17:30
  • Log is in var/log/exception.log and var/log/system.log but you must remove them and test for generate a new logs – Mohamed El Mrabet Nov 23 '17 at 19:12
  • I generate a new logs but is log. How can I do? – Alessandro Nov 23 '17 at 20:10

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