在 Magento 中如何调用 cms 页面中的 phtml 文件来设置页面标题我在 phtml 文件中设置的标题?我正在使用
$this->getLayout()->getBlock('head')->setTitle('your title');
设置页面标题。
最佳答案
在cms页面或cms静态 block 中调用phtml文件:
{{block type="core/template" template="templateFolder/your_template.phtml"}}
如果您知道 phtml 文件的 block 文件(php 文件)所在的位置,那么您可以将其用作类型。
例子:假设你想调用位于catalog/product文件夹中的new.phtml文件,并且你知道它对应的Block文件(php文件)位于Catalog/Product文件夹中,那么你可以使用:
{{block type="catalog/product" template="catalog/product/new.phtml"}}
更多阅读:here
希望这对您有所帮助!
关于php - 如何在cms页面调用phtml文件设置页面标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17500362/