I would like to add the content of a phtml file into a static block on Magento

phtml file is in:


with a very basic code I will edit later:


static block's ID is freeshipcart, with the following content:

<p><a href="spedizioni-e-consegne/"><img alt="" src="{{media url="wysiwyg/ShippingPerCarrello.jpg"}}" /></a></p>
<p>{{block type="freeshipcart/soglia" name="soglia" template="Pbs_Freeship/soglia.phtml"}}</p>

"freeshipcart/soglia" is allowed in Blocks Permission.

Can't figure it out why this static block shows all but "hello" from the phtml file. Am I missing something?

  • The block freeshipcart/soglia exists? Did you try core/templateinstead?
    – luemic
    May 18 '16 at 10:34
  • It worked with core/template, I misunderstood the block type values. Thanks!
    – randomz
    May 18 '16 at 11:34

Add these code in content of static block you created.

{{block type="core/template" name="myCustom" template="cms/my_custom.phtml"}}

also add your File in this Location cms/my_custom.phtml

  • Do you mean /app/design/frontend/base/default/template/cms/my_custom.phtml?
    – randomz
    May 18 '16 at 11:12
  • 1
    yes i meant that only..
    – Arjun
    May 18 '16 at 11:17
  • It worked, then I added core/template to my block and static block showed also my phtml file. Thanks!
    – randomz
    May 18 '16 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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