3

Magento 2: How to enable newly created admin theme & override module?

After achieving this I have a new issue now.

I'm using CDN & in Production Mode. In the Developer mode, it works fine.

I have below configuration in Admin

Admin -> Stores -> Configuration -> Advanced -> Developer

1] JavaScript Settings
    Merge JavaScript Files -> Yes
    Enable JavaScript Bundling -> Yes
    Minify JavaScript Files -> Yes

2] CSS Settings
    Merge CSS Files -> Yes
    Minify CSS Files -> Yes

Developer Mode:

https://cdn.domain.com/pub/static/adminhtml/Alphanova/Theme/en_US/requirejs/require.js

https://cdn.domain.com/pub/static/adminhtml/Alphanova/Theme/en_US/mage/requirejs/mixins.js

Production Mode:

https://cdn.domain.com/pub/static/adminhtml/Alphanova/Theme/en_US/requirejs/require.min.js

Admin is not working due to JS not loading. Above are just a few JS files.

https://cdn.domain.com/pub/static/adminhtml/Alphanova/Theme/en_US/mage/requirejs/mixins.min.js

In Production Mode I'm not able to locate the file on above location.

magento/pub/static/adminhtml/Custom/Theme/em_US // ALL FILES SHOULD BE HERE
magento/pub/static/adminhtml/Magento/backend/en_US // ALL FILES STAYS HERE

Magento 2 - Custom admin theme not working in production mode

https://github.com/magento/magento2/issues/3754

1

When creating a new custom theme, if we don't have any assets files under web folder, your theme may be ignored when executing deploy command.

  • Thats the trick, you save my day..! – nuwaus Sep 28 '17 at 19:12
0

Below are the changes needs to apply

magento\app\design\adminhtml\Custom\Theme\theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>My Theme Tile</title>
    <parent>Magento/backend</parent> 
    <media>
        <preview_image>media/preview.png</preview_image>
    </media>
</theme>

I added below files & solved.

 magento\app\design\adminhtml\Custom\Theme\media\preview.png
 magento\app\design\adminhtml\Custom\Theme\web\images\logo.png
0

I installed cdn, but my images no longer appear on the site, and I also can not correctly access my admin panel. How can I reverse the cdn settings?

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.