0

I have installed Magento CE 2.1.2 in my local system Windows 7(64 bit) Uwamp.

Now I have created my custom theme and set it up in the backend. Below are the theme specific files and I have kept some folders like web/css/source, web/fonts, web/images etc. empty, as I want those files to be called directly from parent theme.

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\registration.php:

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

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\theme.xml:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Custom</title> <!-- your theme's name -->
    <parent>Magento/luma</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
    <media>
        <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
    </media>
</theme>

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\Magento_Theme\layout\default_head_blocks.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/source/style.css" />
</head>

and

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\media\preview.jpg

which is copied from Luma Theme.

After setting this same theme from backend, everything else works fine with new theme on frontend, but some css & js files are not being called from the parent theme, which results in icons and logo not displaying at all in frontend Homepage, Product Listing page etc. Also the "Hot Sellers" products block from Homepage disappeared.

Any hints on what could be the issue and how to resolve this ?

1

1 Answer 1

2

When deploying static content, Magento may ignore the assets of custom theme if the assets files(css, js) under web were empty. So, we need to put some css or js files under this folder.

2
  • Blank css/js files or just copy those css/js of Luma theme ?
    – Vicky Dev
    Jan 25, 2017 at 20:03
  • Can be your custom css or from Luma parent theme. Jan 25, 2017 at 23: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.