0

I have just started to use magento and made a child theme of Blank. I have followed the documentation about making a theme at

devdocs.magento.com

And i have activated the theme but the problem is i dont know why require.js or Icons are not loading. I have tried to deploy the static content but no results, do i have to copy them from Parents theme (But shouldn't child theme inherit?)

Console error

Folder Structure

app/design/frontend/myVendor/
├── myTheme/
│   ├── etc/
│   │   ├── view.xml //Copy from vendor/magento/theme-frontend-blank
│   ├── media/
│   │   ├── preview.jpg
│   ├── web/
│   │   ├── images
│   │   │   ├── logo.svg 
│   │   ├── css
│   │   │   ├── source
│   │   ├── fonts
│   │   ├── js
│   ├── registration.php
│   ├── theme.xml
│   ├── composer.json

Also my 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/myVendor/myTheme',__DIR__);

And theme.xml

 <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
 <title>myTheme</title> <!-- your theme's name -->
 <parent>Magento/blank</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>

And also a question, does magento looks in vendor for theme? ( i have read that if it doesnt find it in app/design/frontend that it gets it from vendor)

Issue about this on git with answer

If understood it correctly it wouldnt make me select this theme if it didn't

  • Can you add folder structure of your theme to this question? – DEEP JOSHI May 11 '16 at 7:00
  • @DEEPJOSHI added – MePo May 11 '16 at 7:15
  • In the latest version of Magento 2 you will fid it under design/frontend/Magento – DEEP JOSHI May 11 '16 at 7:51
  • @DEEPJOSHI yeah but i used composer and it isnt inside but from the link i gave this is how its supposed to be (if i understood right) – MePo May 11 '16 at 7:52
  • Core modules was in vendor in Merchant Version. – DEEP JOSHI May 11 '16 at 7:55
3

You have to just create theme inside app/design folder.

Folder Structure

app/design/frontend/Vendor/
├── myTheme/
│   ├── etc/
│   │   ├── view.xml //Copy from vendor/magento/theme-frontend-blank
│   ├── media/
│   │   ├── preview.jpg
│   ├── web/
│   │   ├── images
│   │   │   ├── logo.svg 
│   │   ├── css
│   │   │   ├── source
│   │   ├── fonts
│   │   ├── js
│   ├── registration.php
│   ├── theme.xml
│   ├── composer.json

You have to create layout folder its position is inside module folder.

like, Magento_Catalog/layout/*.xml file

Try using above concepts its working.

Thanks.

  • I will try it again without having to copy from Parents theme. Like you suggested. Magento should inherit that from Parent right? – MePo May 11 '16 at 10:17
  • yes, its get remaining file from paretn blank theme – Rakesh Jesadiya May 11 '16 at 10:18
0

Copy following folders from it's parent theme to your theme:

Magento_Theme media web

For more details on creating Theme in Magento 2:

http://www.chriscrewdson.co.uk/blog/creating-an-magento-2-theme.html

  • 1
    That did the trick, but shouldnt Child theme inherit that from Parent? – MePo May 11 '16 at 9:59
  • This did solve my problem and thank you for that but i was trying to do it with inheritance so i selected Rakesh – MePo May 11 '16 at 10:36
  • Theme fallback will be handled by the xml of that particular module in magento 2. – DEEP JOSHI May 11 '16 at 10:52
  • Will have to reread documentation once more to get this entirely, but thank you again – MePo May 11 '16 at 10:59

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.