10

How to create theme in magento 2 stable version?

There are tutorials available for Beta but not stable.

The steps I took are as follow :-

Created folder inside app/design/frontend/Themevendorname/Themename/ in that created theme.xml & composer.json

but when I gone to admin stores->configuration->General->Design in that Design Theme drop-down........there the new theme is not displayed.

Here are the lines of composer.json

{
    "name": "themevendorname/theme-frontend-themename",
    "description": "N/A",
    "require": {
        "php": "~5.4.11|~5.5.0",
        "magento/framework": "0.1.0-alpha107",
        "magento/magento-composer-installer": "*"
    },
    "type": "magento2-theme",
    "version": "0.1.0-alpha107",
    "extra": {
        "map": [
            [
                "*",
                "frontend/themevendorname/themename"
            ]
        ]
    }
}

Please check the image attached. Another thing is that I also created a folder named theme-frontend-themename inside vendor->magento folder & put the same folders here too but still not getting that theme in admin store->configuration->General->Design in that Design Theme drop-down.

Any Help Please.

enter image description here

6

Any a module, theme or language in Magento2 stable, you need must create a registration.php file in directory contain module/theme/language. Autoload of Composer it load all file registration.php before Magento2 run.

A registration.php file of a theme the following in app/design/<area>/<Vendor>/<theme_name>/:

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
  \Magento\Framework\Component\ComponentRegistrar::THEME,
'<area>/<VendorName>/<theme_name>',  
__DIR__
);
  • 1
    Thanks very much Bill...let me check that quickly & will be coming back :) Thanks again :) – KA9 Dec 16 '15 at 12:53
  • Hi Bill, can you please tell the exact location of module folder because there are many module folders available. – KA9 Dec 16 '15 at 12:57
  • 3
    you need create it in app/design/<area>/<Vendor>/<theme_name>/ – Bill Dec 16 '15 at 12:58
  • 1
    I can't explain correct this question for you but i think in version stable, Magento want core file in vendor/magento/* and after Magento coming soon Market place, they want install, update all core file, third party via composer at vendor directory. – Bill Dec 16 '15 at 14:07
  • 1
    Hi, we recommend developing in app/code or app/design, which is how the Magento 2 GitHub is organized if you clone it. Your registration.php tells the component to install under vendor whenever someone deploys it. – Steve Johnson Dec 18 '15 at 14:50
0

you can use this link :

http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-create.html

-Add or copy from an existing theme.xml to your theme directory app/design/frontend//

-Configure it using the following example:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
 <title>New 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>

-Add 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/<Vendor>/<theme>',
    __DIR__
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.