在Magento中如何调用cms页面中的phtml文件来设置页面标题我在我的phtml文件中设置了哪个标题?我正在使用如何调用cms页面中的phtml文件来设置页面标题
$this->getLayout()->getBlock('head')->setTitle('your title');
设置页面标题。
在Magento中如何调用cms页面中的phtml文件来设置页面标题我在我的phtml文件中设置了哪个标题?我正在使用如何调用cms页面中的phtml文件来设置页面标题
$this->getLayout()->getBlock('head')->setTitle('your title');
设置页面标题。
要调用一个PHTML文件在一个CMS页面或CMS静态块:
{{block type="core/template" template="templateFolder/your_template.phtml"}}
如果你知道,在这里为您PHTML文件的块文件(PHP文件)所在,那么你可以使用它作为类型。
例子:假设你要调用驻留在目录/产品文件夹new.phtml文件,并且您知道它的相应的块文件(PHP文件)驻留在目录/文件夹的产品,那么你可以使用:
{{block type="catalog/product" template="catalog/product/new.phtml"}}
更多阅读:here
希望这有助于!
因为在分析页面(或块)内容时已经呈现head
块,所以在cms块或cms页面中使用页面时,无法将其更改为模板文件的标题。
这是不可能从作为已经@Marius
告诉,你需要给它添加CMS的网页PHTML文件更改网页标题的设计在CMS页面,如下所示:
<reference name="head">
<action method="setCustomTitle" translate="title"> <title> Custom Title </title> </action>
</reference>
添加下面CMS下XML块>页>管理内容>选择一个特定的CMS页面
导航到 “设计” 选项卡>布局更新XML>
<reference name="head">
<action method="setCustomTitle" translate="title"> <title> Custom Title </title> </action>
</reference>
确保CACHE文件夹下有删除: {根文件夹的Magento}在/ var /缓存 {根文件夹的Magento}在/ var/full_page_cache
希望这有助于!
快乐编码...