Danijel Daxx Chalupka
Danijel Daxx Chalupka

Reputation: 55

Getting current page - Magento

The thing is that I have logo displayed on only homepage in Magento checking if it's homepage with getIsHomepage();. Now the thing I want to do is to display logo inside header only on Dashboard page, do you know any alternative to getIsHomepage but to check if it's My account page?

Thanks

Upvotes: 0

Views: 494

Answers (2)

Gerard de Visser
Gerard de Visser

Reputation: 8050

It's best practice to use xml to do this instead of parsing url. Add this to your local.xml:

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

And copy and edit your header.phtml file to template/page/html/customer_account_header.phtml

Upvotes: 1

Amit Bera
Amit Bera

Reputation: 7611

If you want to out logic for customer account page then

First fetch current routers and controllers and action to headere.phtml

logic is like for magento customer dasboard page url is customer/account/index

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

}

?>

Upvotes: 0

Related Questions