9

This method works for Magento 1 but not for Magento 2 (version 0.42.0-beta10): http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/admin/using_custom_admin_theme_templates

10

The Process is quite similar to creating a theme for frontend.

1. Create theme.xml in

app/design/adminhtml/<yourpackage>/<yourtheme>/theme.xml

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

2. Register theme in

app/design/adminhtml/<yourpackage>/<yourtheme>/registration.php

3. Enable theme.

you can enable frontend theme in admin, but for backend you need to enable the theme through di.xml 

in app/code/Magento/Theme/etc/di.xml, you can find block of code below. add this block of code to your module and change adminhtml to your admin package and theme name.

    <type name="Magento\Theme\Model\View\Design">
       <arguments>
          <argument name="themes" xsi:type="array">
            <item name="frontend" xsi:type="string">Magento/luma</item>
            <item name="adminhtml" xsi:type="string">Magento/backend</item>
         </argument>
      </arguments>
    </type>

Now you can overwrite something in you admin theme to see whether it works.

  • thx, very usefull! – LucScu Jun 15 '16 at 7:21
  • 2
    step 3 improved here magento.stackexchange.com/a/120960/23344 – LucScu Jun 15 '16 at 7:36
  • 1
    after setup:static-content:deploy nothing is created to my new adminhtml theme, what I'm missing? I try several config on the composer.json but still no create nothing under static content. Any suggestion? – AleGrinGo Jun 15 '16 at 16:28
  • 2
    My custom admin theme has no static files generated after running setup:static-content:deploy – Vasilii Burlacu Aug 6 '16 at 9:51
  • me too! how do you resolve it? – LucScu Sep 27 '16 at 12:22
2

The theme system has changed a bit in Magento 2 but there are similarities.
First you need to create a theme folder in app/design/frontend. The folder structure is similar to the modules structure. You have to have a vendor name (in Magento 1 was called package) and a theme folder .

So create app/design/frontend/Vendor/theme.
Then you have to declare your theme.
you need to create inside your theme folder a file theme.xml with the following content:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd">
    <title>Your theme name</title>
    <parent>Magento/blank</parent><!-- or any other parent theme similar to Magento 1.9 -->
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

then create a preview image of your theme inside your theme in the media folder(create this also) and call the preview image preview.jpg (as declared in the XML above).

Now your theme is set.
If you want to change something from the parent theme all you need to do is copy the file you want to change (layout, template) to your theme from the specific module and do your magic.

For example if you want to change the way that the product view page looks like copy the file app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml to app/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml and change what you need.

More details about creating a theme can be found here.
I also found a sample theme that you can use as guideline.
You can also install the official sample data and you will get a theme called luma where you can see the folder structure.

  • Thanks for you answer! But I think I need to translate my bad, sorry. – Mathieu Mar 2 '15 at 10:16
  • I want overiding backend theme (admin theme), not frontend. – Mathieu Mar 2 '15 at 10:17
  • That's no problem. The steps are the same, but instead of frontend use adminhtml in the folder structure. The principle is the same. – Marius Mar 2 '15 at 10:21
  • Ok, thanks. But, I do not understand how to declare the new theme for admin. Is there :"app/code/Magento/Backend/etc/config.xml" ? – Mathieu Mar 2 '15 at 10:34
  • <stores> <admin> <design> <package> <name>default</name> </package> <theme> <default>backend</default> </theme> </design> </admin> </stores> – Mathieu Mar 2 '15 at 10:34
2

In case someone has problems with generating static files for newly created admin theme. In order for magento to generate files for backend theme on setup:static-content:deploy, app/design/adminhtml/<yourpackage>/<yourtheme>/web/ folder should contain files. Any dummy file would do the job.

  • I created a blank main.css in a web folder and I still get no static files created – Scott Apr 24 '18 at 23:05
  • @Scott Have you also done all the required steps that Marius suggested in his answer? And how exactly relative path to main.css looks like in your occasion? – V3N0m21 Apr 25 '18 at 13:43
0

To create admin Theme please follow below links, it must be work.

https://github.com/manishjoy/magento2-admin-theme

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.