I am trying to develop my own magento module and I have a problem with the xml layout file that I want to override. I am working to personalize the login form with / customer / account / login.
For this purpose I have the following files
app/ etc/ modules/ - IT_CustomerCar.xml code/ local/ IT/ CustomerCar/ Block/ Customer/ From/ Login.php controllers/ - AccountController.php etc/ - config.xml design/ frontend/ base/ default/ layout/ - customercar.xml template/ customercar/ form/ - login.phtml'
My goal is to override the /design/frontend/base/default/layout/customer.xml file to personalize the login form.
Now, to be more specific about my files
The config.xml file contains the following lines:
<config> <modules> <it_customercar> <version>0.1.0</version> </it_customercar> </modules> <global> <rewrite> <it_customercar_customer_account> <from><![CDATA[#^/customer/account/#]]> </from> <to>/customercar/account/</to> </it_customercar_customer_account> </rewrite> <blocks> <customer> <rewrite> <form_login>IT_CustomerCar_Block_Customer_Form_Login</form_login> </rewrite> </customer> <helpers> <customercar> <class>It_CustomerCar_Helper</class> </customercar> </helpers> </blocks> </global> <frontend> <routers> <it_customercar> <use>standard</use> <args> <module>IT_CustomerCar</module> <frontName>customercar</frontName> </args> </it_customercar> </routers> <layout> <updates> <it_customercar> <file>customercar.xml</file> </it_customercar> </updates> </layout> </frontend>
My customercar.xml (which is supposedly my xml layout file) is as follows:
<?xml version="1.0"?> <layout version="0.1.0"> <default> </default> <customercar_account_login> <label>MODULE : Customer Account Login Form</label> <reference name="content"> <block type="core/template" name="customercar_form_login" output="toHtml" template="customercar/form/login.phtml" ></block> </reference> </customercar_account_login> </layout>
In my block, IT_CustomerCar_Block_Customer_Form_Login, I add this line return $html . 'block'; return $html . 'block'; to check if it is really caused. And this. There is a "block" line just below my login form, as expected.
On the other hand, the customercar.xml file seems to be ignored. I used the Allan Storm LayoutViewer module to check my page, and the layout is still one of the main ones.
edit: I also add var_dump($this->getTemplate()); to my _toHtml method from the Block class. And that shows that line: string(36) "persistent/customer/form/login.phtml" . I really don't understand why by the way. I was expecting "/customer/form/login.phtml" and not the one from the "permanent" folder.
I think I am missing something obvious, but I tried to follow the advice and advice without any success. This problem seems very common, and I thought I could fix it quickly. I was wrong ... I hope you can help me,
Thanks:)
Decision
I manage to fix this with dagfr answer.
First, I will disable the persistent module from the backend and /app/etc/modules/Mage_Persistent.xml .
Then I modify my customercar.xml file to
<customer_account_login> <reference name="customer_form_login"> <action method="setTemplate"><template>customercar/form/login.phtml</template></action> </reference>