0

I'm trying to edit some page titles and meta descriptions on a custom theme in Magento 1.4.1 (I just inherited this project and it's my first time working with Magento). I've tried in both app/design/frontend/default/default1/layout/local.xml and the theme layout xml files like layout/customer.xml. Here is my local.xml:

<?xml version="1.0"?>
<layout version="0.1.0">
    <checkout_cart_index>
        <reference name="head">
            <action method="setDescription" translate="title">
                <title>This page sumarizes your shopping cart with Store Name. Use this page to checkout and place your order. Please call us at tel with any questions.</title>
            </action>
        </reference>
    </checkout_cart_index>

    <customer_account_login>
        <reference name="head">
            <action method="setTitle" translate="title">
                <title>Login to your account on store.com. Once you login, you may review your account information and make changes easily. To begin, login below.</title>
            </action>
        </reference>
    </customer_account_login>

    <custom_account_forgotpassword>
        <reference name="head">
            <action method="setTitle" translate="title">
                <title>Forgot Password</title>
            </action>
        </reference>
    </custom_account_forgotpassword>



</layout>

I've cleared and refreshed cache on the admin panel. What am I missing?

1 Answer 1

1

The problem is that the title properly already is set and loaded. Therefore you cannot change the title - check your php log for messages regarding setTitle errors like this:

PHP Fatal error:  Call to a member function setTitle() on boolean in .../public_html/app/code/core/Mage/Customer/Block/Form/Login.php on line 40

Fix:

[theme-name]/template/page/html/head.phtml

<title><?php echo ($this->getForcedTitle()) ? Mage::getStoreConfig('design/head/title_prefix').' '.$this->getForcedTitle().' '.Mage::getStoreConfig('design/head/title_suffix') : $this->getTitle() ?></title>

Change your setTitle updates in local.xml to setForcedTitle instead.

Use the same logic for the meta tags.

4
  • Just read that somewhere and seems like the way to go. I will update it and let you know! Thanks!
    – metame
    Feb 10, 2016 at 18:48
  • Hmmm. Looks like the handles I was trying to update the page title on are actually just forms, not pages... So I have to try to find the page handles for all of these things.
    – metame
    Feb 11, 2016 at 15:51
  • Don't I need to add those methods to some sort of controller or class for them to work??
    – metame
    Feb 11, 2016 at 16:02
  • for changing page titles, the provided code should be sufficient. Feb 22, 2016 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.