0

I am trying to create a custom theme for admin panel in magento 2.3.0. Below are the steps which i have followed:

1) Created a folder structure in

app/design/adminhtml/Vendor name/theme name

2) Added theme.xml and added below code:

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

3) Added registration.php and added below code:

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/vendor name/theme name', __DIR__);

4) Added a module to change admin panel login logo:

added Magento_Backend folder

added layout folder

added admin_login.xml and below code into it

   <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_image_src" xsi:type="string">images/Logo_Icon_Black.svg</argument>
            </arguments>
        </referenceBlock>
    </body>
 </page>

5) after creating above folders trying to run below commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

Still my changes are not getting relfected. Any help would be appreciated

0

After create a theme, you have to Create a Module to Declare Theme.

Step 1: Create the registration.php file

app/code/Vendor/Backend/registration.php

<?php
    \Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,    
    'Vendor_Backend',__DIR__);
?>

app/code/Vendor/Backend/etc/module.xml

<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Backend" setup_version="0.0.1">
        <sequence><module name="Magento_Theme"/></sequence>
    </module>
</config>

app/code/Vendor/Backend/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Theme\Model\View\Design">       
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="adminhtml" xsi:type="string">Vendor/ThemeName</item>
            </argument>
        </arguments>
    </type>
</config>

And then run commands.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

You can refer this URLs,

Create a theme:

 https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/admin_theme_create.html

Apply theme:

 https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/admin_theme_apply.html
|improve this answer|||||

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.