0

I tried,

app/design/frontend/Magestore/sample/composer.json

{
"name": "magento/sample-module-theme",
"description": "N/A",
"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/theme-frontend-luma": "~100.0",
    "magento/framework": "~100.0"
},
"type": "magento2-theme",
"version": "1.0.0",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"autoload": {
    "files": [ "registration.php" ]
}
}

app/design/frontend/Magestore/sample/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Magestore/sample',
__DIR__
);

app/design/frontend/Magestore/sample/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Magestore Sample Theme12</title>
<parent>Magento/luma</parent>
</theme>

app/design/frontend/Magestore/sample/Magento_Customer/layout/customer_account_login.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">
    <body>
    <referenceBlock name="customer_form_login">
        <action method="setTemplate">
         <argument name="template" xsi:type="string">Magestore_Sample::form/login.phtml</argument>
       </action>
    </referenceBlock>
    </body>
</page>

app/design/frontend/Magestore/sample/Magento_Customer/templates/form/login.phtml

<?php 
     echo $welcomeMessage = "Login Page";
 ?>
1
  • You need to set your theme from admin then your code will work for you. Jun 20, 2017 at 10:59

2 Answers 2

1

First you need to check theme is applied or not. You can check your current theme by ctr + U, you can see current theme path in .css and .js file.

In your case Magestore/Sample display in .css and .js file path. If display it, theme is set properly.

Run below command

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

php bin/magento cache:clean

Now you can see your changes.

Let me know if you have any query.

13
  • there is no effect
    – jassi
    Jun 20, 2017 at 10:36
  • Check it with clean magento cache. Jun 20, 2017 at 10:37
  • clear and disable cache Jun 20, 2017 at 10:37
  • still no effect. In admin, Applied theme field is there in that one of the dropdown option is my theme but I have not applied and saved.
    – jassi
    Jun 20, 2017 at 10:43
  • Apply my update answer code. It will work for you. Jun 20, 2017 at 10:45
0

You have to simply override login.phtml file in your theme app/design/frontend/Magestore/Sample/Magento_Customer/templates/form/login.phtml no need to write in layout file

 echo $welcomeMessage = "Login Page";
6
  • but still there is no effect
    – jassi
    Jun 20, 2017 at 10:06
  • your theme is working or not? Jun 20, 2017 at 10:07
  • how to find theme is working or not?
    – jassi
    Jun 20, 2017 at 10:11
  • open admin panel and see under Content->Design->Configuration->and check theme Jun 20, 2017 at 10:15
  • please make sure your theme name is correct , make it Magestore/sample not Magestore/Sample. Jun 20, 2017 at 10:16

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.