0

I am using Magento 2.0.1 and I created a custom theme in app\design\frontend\MyTheme

Now, I am setting my custom theme in back end and I created following folders and files

\web

\media

\etc 

registration.php

theme.xml

After this, I pasted the folders of Magento_Module

from \vendor\magento\theme-blank of Magento_Module to app\design\frontend\mytheme.

My structure is app/design/frontend/vendor_name/theme_name.

In this folder I have three folders: \etc \media \web and other two files registration.php and theme.xml.

The problem is that I can not understand why the files phtml template Magento can not read them from path of my theme. Magento reads files phtml of the site only in this path \vendor\magento\magento_module.

Why this?

Thank you very much.

  • Are you able to choose your theme from the admin panel? Does it show up in the list of themes? – andyjv Jan 29 '16 at 14:09
0

Assuming I am reading your question correctly, you have your files under app/design/frontend/Theme. The correct structure is app/design/frontend/Vendor_Name/theme_name.

| improve this answer | |
  • My structure is app/design/frontend/vendor_name/theme_name. In this folder i have three folders: \etc \media \web and other two files registration.php and theme.xml. The problem is that I can not understand why the files phtml template Magento not read them from my path of my theme. Magento reads files phtml of the site only in this path \vendor\magento\magento_module. Thanks. – Gabriel91 Jan 29 '16 at 15:34
0

It is theme fallback mechanism. For some reasons if magento can't find files to render it will fallback to parent code. If still not found it will back to base core

/**
 * Find asset file via fallback mechanism
 *
 * @param LocalInterface $asset
 * @param \Magento\Framework\View\Asset\File\FallbackContext $context
 * @return bool|string
 */
private function findFileThroughFallback(
    LocalInterface $asset,
    \Magento\Framework\View\Asset\File\FallbackContext $context
) {
    $themeModel = $this->themeList->getThemeByFullPath($context->getAreaCode() . '/' . $context->getThemePath());
    $sourceFile = $this->fallback->getFile(
        $context->getAreaCode(),
        $themeModel,
        $context->getLocale(),
        $asset->getFilePath(),
        $asset->getModule()
    );
    return $sourceFile;
}
| 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.