Magento 2 Copying Template/View Files from Luma into My own Theme

Magento 2 Copying Template/View Files from Luma into My own Theme

August 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2 Copying Template/View Files from Luma into My own Theme

Copying Magento 2 Template/Viewer Files from Luma into Your Own Theme

Hello developers! Today we’re going to explore how to copy view files and templates from the built-in Luma theme in Magento 2 and use them in your own custom theme. This process is quite straightforward once you understand the folder structure and naming conventions used by Magento.

Understanding Magento’s Theme Structure

Before diving into copying files, let me clarify some key points about Magento themes:

  1. Base themes: These are the parent themes that your custom theme inherits from.
  2. Child themes: Your custom theme is a child of one or more base themes.
  3. Views and Templates: The view folder contains layout XML files (layouts) and PHP templates (.phtml)

Step 1: Determine What to Copy

You want to copy the views and layouts used in Magento’s Luma theme. These are located under:

vendor/magento/theme-frontend-luma/view/

For example, if you’re targeting the product view, look for this folder structure:

vendor/magento/theme-frontend-luma/view/frontend/templates/catalog/product/view.phtml

This is a PHP template file that renders the basic layout of a product page in Luma.

Step 2: Identify Where to Place Them

In your custom theme, you should replicate this same folder structure under:

app/design/frontend/{Vendor}/{Theme}/view/frontend/

Replace {Vendor} and {Theme} with your actual vendor name and theme key. For example:

app/design/frontend/LaravelCompany/mytheme/view/frontend/

Step 3: Copy the Files

Now, simply copy the desired layout XML files and PHP templates from Luma to these folders in your custom theme.

Example file paths for copying:

  • Layouts: vendor/magento/theme-frontend-luma/view/frontend/layout → app/design/frontend/LaravelCompany/mytheme/view/frontend/layout

  • Templates: vendor/magento/theme-frontend-luma/view/frontend/templates → app/design/frontend/LaravelCompany/mytheme/view/frontend/templates

Step 4: Customize the Copied Files

Once you have copied these files into your theme, you can modify them as needed to achieve your desired layout and design. Remember, any changes made here will only affect your custom theme.

Best Practices for Copying Files

  1. Carefully identify which specific views and layouts need to be modified.
  2. Always backup the original Luma files before overwriting them with your copies.
  3. Keep track of which files you have modified in case you need to update to a newer Magento version later.

That’s it! You’ve now successfully copied view templates and layout XML files from Luma into your own Magento 2 theme. This gives you the flexibility to customize the frontend design without the risk of losing changes during updates.

Don’t forget, for more advanced theming techniques like adding custom CSS or JavaScript, check out our guide on Magento 2 Theme Development which goes into even greater depth. Happy theming!

This blog post is by Laravel Company, a team of experienced Magento developers offering professional eCommerce solutions.

Magento 2 Catalog Themes

Our network