Magento是一个电子商务系统,其SEO功能强大,而且产品的分类标题等信息可以在后台随时进行更改,不能修改的信息通过Magento后台代码进行修改。那么,你会在Magento修改页面标题吗?具体流程如下:
找到app/design/frontend/your_package/your_theme/template/page/html/head.phtml文件夹。将<title><?php echo $this->getTitle() ?></title>
改为<title><?php echo ($this->getMyTitle()) ? Mage::getStoreConfig('design/head/title_prefix').' '.$this- >getMyTitle().' '.Mage::getStoreConfig('design/head/title_suffix') : $this->getTitle(); ?></title>
查找customer.xml的layout文件,以登陆页面标题为例:
<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>