magento首页title怎么修改
2个回答
推荐于2016-05-06
展开全部
修改有3种方法,分别如下:
1、在controller中;
[php] view plaincopy
$this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
2、在block或phtml文件中;
[php] view plaincopy
$this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
3、在布局文件中配置;
[html] view plaincopy
<reference name="head">
<action method="setTitle" translate="title" module="customer"><title>Forgot Your Password</title></action>
</reference>
其实上面这三种方法的原理都是一样的,就是调用head block的setTitle方法。
1、在controller中;
[php] view plaincopy
$this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
2、在block或phtml文件中;
[php] view plaincopy
$this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
3、在布局文件中配置;
[html] view plaincopy
<reference name="head">
<action method="setTitle" translate="title" module="customer"><title>Forgot Your Password</title></action>
</reference>
其实上面这三种方法的原理都是一样的,就是调用head block的setTitle方法。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询