Can I call a phtml file as a block?
-
05-10-2020 - |
문제
I have a file in my package myPackage/default/template/testpage/test.phtml
with something like:
<?php
echo 'Test'
?>
How can I call it as a block in a cms->page
?
I tried to use {{block type="page/template_testpage_test" template="testpage/test.phtml"}}
but nothing happens.
How should I call the type=A/B
?
Thanks
해결책
The basic block for templates is core/template
. So the CMS code in your case is
{{block type="core/template" template="testpage/test.phtml"}}
But in order for this to work, you have to add the block type core/template
to the whitelist in System > Permissions > Blocks
제휴하지 않습니다 magento.stackexchange