11

i just create new test theme but it is not showing in admin panel theme list

app/design/frontend/Magento/mytheme/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>My theme</title> <!-- your theme's name -->
     <parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <media>
         <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
     </media>
 </theme>
2
  • I have similar issue. The only difference, I created my new blank theme with a different Vendor name than "Magento". Is that allowed? So my structure is: app/code/design/mycompany/mynewtheme/ I just cannot make it work - in admin panel there's only Luma and Magento blank default themes, there's no new theme I created.
    – stamster
    Commented May 9, 2016 at 16:32
  • did you deploy the content and check pub/static folder . i will be great if you post new question with your code it is more helpful to give solution. Commented May 9, 2016 at 18:34

6 Answers 6

8

In my case, it worked after I ran the following command from the Magento 2 root folder:

php bin/magento setup:upgrade

If it doesn't work, then you may run the command with sudo:

sudo php bin/magento setup:upgrade
0
8

figure out by myself. i was missing the

app/design/frontend/Magento/mytheme/composer.json

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

app/design/frontend/Magento/mytheme/registration.php

<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Magento/mytheme',
    __DIR__
);

Reference

0
6

Follow steps for create new theme:

step : 1 (theme.xml inside app/design/frontend/Magento/companyname)

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Magento Companyname</title>
    <parent>Magento/luma</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

Step : 2 (registration.php inside app/design/frontend/Magento/companyname)

In this file, we must use companyname in small case for defined value of our theme frontend/Magento/companyname.

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

Step : 3 composer.json (composer.json inside app/design/frontend/Magento/companyname)

{
    "name": "magento/theme-frontend-companyname",
    "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": "100.0.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}
5

I had similar issues with my custom theme not showing in Magento 2.1.6, however, it seems that my files were correct as per the instructions found on Magento Dev Docs - http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html

My issue may have been due to the mode being set to production rather than developer due to speed issues running on localhost.

I found that the theme wouldn't show however until I had run the following in shell...

php bin/magento cache:clean
php bin/magento setup:upgrade 
php bin/magento setup:static-content:deploy
3
  • maybe you didn't set the developer mode . Commented May 18, 2017 at 5:53
  • @QaisarSatti this is true, I was running in production mode due to slow issues on localhost. Commented May 18, 2017 at 7:57
  • 1
    you must mention production mode in your answer too Commented May 18, 2017 at 8:12
2

I had the same problem. I accidentially created registration.xml instead of registration.php

0

Follow bellow steps

step : 1 (theme.xml)

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Magento Apple</title>
    <parent>Magento/luma</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

Step : 2 (registration.php)

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

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

Step : 3 composer.json

{
    "name": "magento/theme-frontend-apple",
    "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": "100.0.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

More Details

1
  • I have followed these steps and it worked, however, I needed to change theme.xml file in order to change the title and add a parent theme, however, change is not refreshed. I have the cache disabled, so I don't know what else to try.
    – jstuardo
    Commented Feb 1, 2016 at 1:33

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.