2014-07-01 205 views
0

问题是,我只在Magento的主页上显示徽标,检查它是否与getIsHomepage();主页一致。现在我想要做的事情是只在仪表板页面的标题内显示徽标,你知道getIsHomepage的替代方案,但要检查它是否是我的账户页面吗?获取当前页面 - Magento

感谢

+0

你的管理工作>仪表盘雅客户账户? –

+0

我正在谈论前端的客户账户 –

回答

1

最好的做法是使用xml来完成此操作d解析url。添加到您的local.xml中:

<customer_account_index> 
    <reference name="header"> 
      <action method="setTemplate"><template>page/html/customer_account_header.phtml</template></action> 
     </reference> 
</customer_account_index> 

复制和编辑header.phtml文件template/page/html/customer_account_header.phtml

+0

我对所有页面的页眉定义一样,这会覆盖它吗? –

+0

是的,这将只覆盖客户帐户页面。 –

+1

杰拉德,很高兴看到这个委员会的人最终提倡使用local.xml文件! – Rob

0

如果你想出去客户账户页面逻辑则

首先读取当前路由器和控制器和行动headere.phtml

逻辑就像是 为Magento的客户dasboard页面网址是客户/帐户/索引

then 
<?php $action = Mage::app()->getFrontController()->getAction(); 
echo $action->getFullActionName('_'); 
if($action->getFullActionName('_')=="customer_account_index") 
{ 

} 

?>