I created my custom theme based on Magento Luma theme:
- In
/app/design/frontend/MyVendorName/ncs-theme/theme.xmlI added<parent>Magento/luma</parent>
But when I look at my frontend I see some differences. For example on the product-view page (see attachment), the structure of <div class="product-info-price"> is different then the Luma theme?
enter image description here
And on the homepage it's also missing styles for the <div class="content-heading"> (see image). Do I have to copy some files into my custom theme?
2 Answers 2
Use the commmand line tool to regenerate the static files and the cache.
I would also try running your server as an administrator so that it doesn't have any issues with symlinks.
http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli.html
-
11) I am using MAMP for local development. How do run my server as an administrator? 2) My mode is 'development', before I already did
php bin/magento setup:static-content:deployand cleared cash?meez– meez2016年06月06日 11:34:35 +00:00Commented Jun 6, 2016 at 11:34 -
Setup:static-content:deploy is useless and takes too long.LM_Fielding– LM_Fielding2016年06月06日 12:31:09 +00:00Commented Jun 6, 2016 at 12:31
-
1Ok I will install Grunt. Thanks. But regarding my first image. What is missing here? If I look in
/vendor/magento/theme-frontend-luma/Magento_Catalog/layout/catalog_product_view.xml. I see Luma theme is changing the HTML structure here. But why it's not visible on my frontend, while Luma is my parent theme and my custom theme should inherit everything from Luma theme isn't it?meez– meez2016年06月06日 12:48:00 +00:00Commented Jun 6, 2016 at 12:48 -
1But do I have to replace it to my custom theme folder? I am not going to change that file... If I am not going to change it, why should I copy it over?meez– meez2016年06月06日 12:56:48 +00:00Commented Jun 6, 2016 at 12:56
-
1What do you mean with 'Is the theme applied through admin', like I did explained below? I setup my custom theme like explained here and then I by
admin/system_config/edit/section/designmeez– meez2016年06月06日 15:54:57 +00:00Commented Jun 6, 2016 at 15:54
Have you added the registration.php file too? That is also the required file to be added in new custom theme. If you are facing product view related issues then you can also put the file etc/view.xml from luma to your custom theme. Custom theme requires two files be added always:
Registration.php
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::THEME, 'frontend/{{vendor}}/{{theme}}', __DIR__ );Theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Your Theme</title> <parent>Magento/luma</parent> <media> <preview_image>media/preview.jpg</preview_image> </media> </theme>etc/view.xml (optional) : if you set blank theme as parent then you need to add this, however, I would suggest to add this file too in case you are facing issues to display product data with luma as parent. You can simply copy it from luma to your custom theme.
Explore related questions
See similar questions with these tags.