如何更改Magento指定页面的标题(title)?

1.首先你必须找到模版包下的head.phtml,路径如app/design/frontend/your_package/your_theme/template/page/html/head.phtml

2.查找一下行:

[php]
<title><?php echo $this->getTitle() ?></title>[/php]

3.替换为如下的代码:

[php]
<title><?php echo ($this->getMyTitle()) ?
Mage::getStoreConfig(‘design/head/title_prefix’).’ ‘.$this->getMyTitle().’ ‘.Mage::getStoreConfig(‘design/head/title_suffix’)
: $this->getTitle(); ?></title>[/php]

4.查找比如customer.xml的layout文件,这里我们改登录页的title

[php]

<pre> <customer_account_login translate="label">
<label>Customer Account Login Form</label>
<!– Mage_Customer –>
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml"/>
</reference>
<!– New reference for page title starts –>
<reference name="head">
<action method="setMyTitle" translate="title"><title>Buyer
Login</title></action>
</reference>
<!– // New reference for page title ends –>
</customer_account_login>[/php]

转自:http://blog.csdn.net/ddjohn/article/details/6212842

三五电影网www.35535.net

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值