0

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

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

1 Answer 1

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>
7
  • 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
    Commented Nov 23, 2017 at 15:38
  • You can see in your logs? are you sure that you use Magento/luma as theme? Commented Nov 23, 2017 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
    Commented Nov 23, 2017 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 Commented Nov 23, 2017 at 19:12
  • I generate a new logs but is log. How can I do?
    – Alessandro
    Commented Nov 23, 2017 at 20:10

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