0

I have followed the dev docs on 2.2 to create an admin theme.

http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/themes/admin_theme_create.html

When I run php bin/magento setup:upgrade I receive the following error, but I even checked my module against the admin theme dev docs again.

Module 'Magento_Theme':

Running data recurring...Field title can't be empty

my app/design/Snow/wonderland/theme.xml file

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Wonderland</title> <!-- your theme's name -->
    <parent>Magento/backend</parent> <!-- the parent theme. Example: Magento/backend -->
</theme>

my registration.php file

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'adminhtml/Snow/wonderland', // Example: 'adminhtml/Magento/backend'
    __DIR__
);

my /etc/adminhtml/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <!-- Admin theme. Start -->
    <type name="Magento\Theme\Model\View\Design">
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="adminhtml" xsi:type="string">Snow/wonderland</item> <!-- Example: "Magento/backend" -->
            </argument>
        </arguments>
    </type>
    <!-- Admin theme. End -->
</config>

My /etc/module.xml

<module name="Snow_wonderland" setup_version="2.0.1"> <!-- Example: "Magento_Backend -->"
    <sequence>
        <module name="Magento_Theme"/>
    </sequence>
</module>
1
  • but those files (/etc/adminhtml/di.xml and /etc/module.xml) are from module not from theme. They should be in app/code/Vendor/Module. Also maybe <?xml version="1.0"?> is missing in yours xml files?
    – krybbio
    Mar 9, 2018 at 14:59

1 Answer 1

0

You forgot to add a title value in the theme.xml file.

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>[VALUE HERE]</title>
    <parent>Magento/blank</parent>
</theme>

EDIT:

Make sure you have your theme under app/design/adminhtml/Vendor/Theme. A link a about backend themes here.

8
  • Updating original post to show what I had.
    – camdixon
    Mar 9, 2018 at 14:21
  • I have the title there, and it still gave error. However, did I do something wrong here or should I specify package?
    – camdixon
    Mar 9, 2018 at 14:22
  • do you have the correct folder structure? like app/design/adminhtml/Company/Theme?
    – Adrian Z.
    Mar 9, 2018 at 14:26
  • Yes, I do. app/design/adminhtml/Snow/wonderland
    – camdixon
    Mar 9, 2018 at 14:30
  • Do you use linux? Maybe the folder name and the registration name are not the same case.
    – Adrian Z.
    Mar 9, 2018 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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