I'm trying to overwrite contact form but it's unable to overriding. For this I have followed below steps.
Step 1) app/code/Learning/Contact/composer.json
{
"name": "learning/contact",
"description": "contact",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/framework": "100.0.*",
"magento/module-ui": "100.0.*",
"magento/module-config": "100.0.*"
},
"type": "magento2-module",
"version": "1.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Learning\\Contact\\": ""
}
}
}
Step 2) app/code/Learning/Contact/registration.php
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Learning_Contact',
__DIR__
);
Step 3) app/code/Learning/Contact/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Learning_Contact" setup_version="1.0.0">
<sequence>
<module name="Magento_Contact"/>
</sequence>
</module>
</config>
Step 4) app/code/Learning/Contact/view/frontend/layout/contact_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Contact Us</title>
</head>
<body>
<referenceContainer name="content">
<referenceBlock name="contactForm">
<action method="setTemplate">
<argument name="template" translate="true" xsi:type="string">Learning_Contact::form.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
Step 5) app/code/Learning/Contact/view/frontend/templates/form.phtml
<h1> Hi I'm here.... </h1>
Step 6) cleared cache
php bin/magento cache:clean
Step 7) enabled module
php bin/magento setup:upgrade
Is above steps are correct or something went wrong?
Could you please throw me right direction?