3

I am creating a new theme and would like to start by duplicating the default blank theme and then modify it to become my new theme.

When I checked the frontend developer guides, it indicated the theme files should be within app/design/frontend/Vendor/theme/.

But the structure of magento 2 theme files differs between the github and official magento site download:

  • Github has all the theme files within app/design/frontend/Vendor/theme/ folder
  • Magento 2 official website download has theme files within vendor/magento/theme-frontend-blank/. The app/design/frontend/magento/ folder is empty.

So currently i'm a little bit confused about which magento 2 structure should i use - github or official website download.

Any pointers appreciated.

Edit: I have found the same question on M2 forums but currently without replies.

7

I also had the same question. I will reference an answer I found on github that gave me a slightly better understanding of the structure.

When installing via Composer (as recommended for production sites or anyone else wanting stability), Composer puts it under the vendor directory. This is standard Composer behavior. So "vendor/Magento/theme-frontend-blank" is the root directory of the Composer package holding the blank theme. Magento will find the theme over in that directory as well. (This is one of the reasons there is a "registration.php" file in themes (and modules) now. It tells Magento where the theme sits on disk.) So while developing a theme, or if theme is for a local project (not intended to be used across multiple projects), you put it under app/design.

If you decide to sell it on Magento Marketplace for example, there are instructions to bundle it (basically ZIP the directory) and upload to the Marketplace. Other users that download it will have it put in their 'vendor' directory automatically by Composer. The 'vendor' directory holds all code you did not write.

Reference Links:

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.