0

I have already checked this topic and this one

But both them not actually solve 100% my real problem. My theme is installed via composer and it will placed in vendor folder. It's not have any parent for inheritance. Sometimes magento recognize my theme but other try it'doesn't find it

My registration.php for theme

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'vendors/VendorName/theme-name',
__DIR__
);

As you can see theme define above not like any other theme of magento will start with frontend folder

Is this is cause of my problem ? Can anyone in core magento team help me solve this issue! This problem maybe not bug of magento iam not sure
Expect results: I want 100% work theme when i run setup:upgrade . Not ramdomly fail

1 Answer 1

0

I would assume that at least the area (frontend or adminhtml) must be defined in the first part of the theme path like in the blank theme, which would be a good example for a new theme without a parent:

https://github.com/magento/magento2/blob/2.3-develop/app/design/frontend/Magento/blank/registration.php#L9

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
use \Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/blank', __DIR__);

Although they are not getting deeper into it, it's also described that way in the devdocs for new frontend themes: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-create.html

3
  • Seem themes only workaround with path 'adminhtml/' or 'frontend/'. I don't have digging deeper in code to find how magento collect all theme. But i think currently magento not find the theme if folder not from convention folders like admin or frontend
    – mrtuvn
    Commented Jan 25, 2019 at 8:25
  • I mean it totally makes sense since adminhtml and frontend are the 2 areas tha can have themes (devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/…). But I agree that this could be much more explicit and probably should not be in the path (for example having the theme path as just Magento/blank and the component type ComponentRegistrar::FRONTEND_THEME would probably be a much clearer way of declaring them Commented Jan 25, 2019 at 8:38
  • If i need to another area and want to magento deploy assets as same as adminhtml or frontend ! How to do that Example i create new area named 'vendors'. I want my custom theme (no inherrit from magento) show in that area. But seem magento not work with my case. I got some issue with deploy link or read content in new area
    – mrtuvn
    Commented Nov 8, 2019 at 4:01

Your Answer

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

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