-1

Hi I am new in Magento 2 and I want to know where I have to put the vendor/magento/module-theme/view/frontend/layout/default.xml file, I tried to copy the file and put it in c:\wamp\www\kk2\app\design\frontend\Magento\MyStore\layout folder and is not working. I also tried in c:\wamp\www\kk2\app\design\frontend\Magento\MyStore\module-theme\layout and other options but I can't figure where I have to put this to start modifying the theme, the documentation on the Magento offical page is not very clear.

MLavoie
  • 9,671
  • 41
  • 36
  • 56
vlad666
  • 3
  • 2
  • What do you mean, exactly, by "is not working"? Are there any error messages? What behavior is happening vs what you expect? – Kelly Keller-Heikkila Dec 16 '15 at 20:35
  • Hi , i want to start modifying a theme that i have installed and i don't want it to do it in this directory vendor/magento/module-theme/view/frontend/layout/default.xml i want to do it in my theme directory c:\wamp\www\kk2\app\design\frontend\Magento\MyStore\ like in Magento 1 you can do this just copying the file in your template folder but i don't know the right way to do it in Magento 2 – vlad666 Dec 16 '15 at 20:40
  • or there is another way to start theming Magento 2 ?? – vlad666 Dec 16 '15 at 20:42
  • Can you please tell us how you deployed? via zip from magento.com or git clone or composer create project? Also, are you attempting to create your own theme? – Maddy Dec 16 '15 at 20:45
  • via zip from magento.com, i created a theme that inherit from luma's theme – vlad666 Dec 16 '15 at 20:49

2 Answers2

1

You do not need to copy any file. You can create your own theme. Quoting steps in create a theme

  1. Create a directory for the theme under app/design/frontend/<your_vendor_name>/<your_theme_name>.
  2. Add a declaration file theme.xml and optionally create etc directory and create a file named view.xml to the theme directory.
  3. Add a composer.json file.
  4. Add registration.php.
  5. Create directories for CSS, JavaScript, images, and fonts. Configure your theme in the Admin panel.

The Luma theme is not designed to be inherited from. Please see this comment on Github. You can however, inherit from the blank theme as follows:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
 <title>New theme</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>

Maddy
  • 996
  • 8
  • 18
  • ok, my question was not how to create a theme beacuse i already did that, my question is how i need to start to modify my theme, where i have to put the files i want to modify?, for example if i want to modify this vendor/magento/module-theme/view/frontend/layout/default.xml i don't want to modify in that directory beacuse that will cause troubles in future updates, i want to know where i have to put this file in my theme to start modifying ??? – vlad666 Dec 16 '15 at 21:34
  • @vlad666 it's all in the documentation - follow Maddy's link and have a read of it – scrowler Dec 16 '15 at 22:47
  • You will have to extend from that theme, and then remove an element in your theme, and replace it with a new one. Example here http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html#layout_markup_remove_elements – Maddy Dec 16 '15 at 23:13
  • even if i inherit from the blank theme i still don't know where i have to put the file vendor/magento/module-theme/view/frontend/layout/default.xml in my theme to start editing it, the documentation about this is not clear to me – vlad666 Dec 17 '15 at 13:31
0

Create folder and copy default.xml file in your theme

app/design/frontend/magento/<your_theme_name>/magento_theme/layout/default.xml

remove generate folder and run

sudo php -f bin/magento setup:static-content:deploy

It's working

Mark Bertenshaw
  • 5,594
  • 2
  • 27
  • 40