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 ?
-
How about your issue?Khoa Truong– Khoa Truong2017年02月27日 17:18:11 +00:00Commented Feb 27, 2017 at 17:18
1 Answer 1
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.
-
Blank css/js files or just copy those css/js of Luma theme ?Vicky Dev– Vicky Dev2017年01月25日 20:03:04 +00:00Commented Jan 25, 2017 at 20:03
-
Can be your custom css or from Luma parent theme.Khoa Truong– Khoa Truong2017年01月25日 23:32:53 +00:00Commented Jan 25, 2017 at 23:32
Explore related questions
See similar questions with these tags.