I have managed to override the magento's default contact us form, with additional fields and functionality and it seems to work.
The issue is when I disable my module in magento, my customised contact us form is shown instead of the default.
My assumption is that only if my module is active then my customisation (action methods and template) will available/displayed.
I think my issue is to do with overriding layout,block, template.
Some advice would be good.
Here's my code:
app/code/local/MyCompany/ContactsExtension/etc/config.xml
<config>
<modules>
<MyCompany_ContactsExtension>
<version>0.1.0</version>
</MyCompany_ContactsExtension>
</modules>
<frontend>
<routers>
<contacts>
<args>
<modules>
<MyCompany_ContactsExtension before="Mage_Contacts">MyCompany_ContactsExtension</MyCompany_ContactsExtension>
</modules>
</args>
</contacts>
</routers>
</frontend>
<global>
<blocks>
<contactsextension>
<class>MyCompany_ContactsExtension_Block</class>
</contactsextension>
</blocks>
<helpers>
<contactsextension>
<class>MyCompany_ContactsExtension_Helper</class>
</contactsextension>
</helpers>
</global>
</config>
Basically, I copied the default contacts.xml and added my changes. I think I may have not correctly updated it properly.
app/design/frontend/enterprise/mytheme/layout/contactsextension.xml
<layout version="0.1.0">
<default>
<reference name="footer_links">
<action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled"><label>Contact Us</label><url>contacts</url><title>Contact Us</title><prepare>true</prepare></action>
</reference>
</default>
<contacts_index_index translate="label">
<label>Contact Us Form</label>
<reference name="head">
<action method="setTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
<action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
<reference name="content">
<block type="core/template" name="contactForm" template="contactsextension/form.phtml">
<block type="contactsextension/additionalfield" name="contacts.addfields" as="addfields" template="contactsextension/additionalfield.phtml" />
</block>
</reference>
</contacts_index_index>
</layout>
Thanks, duniya.