13

I am trying to extend the Luma Theme in Magento 2,

But it does not work as expected.

I added my Theme,

let it extend from Luma,

flushed all Caches,

Published all Statics and activated the Theme in the Backend.

I would expect, that the Frontend looks like the standard Luma Theme which comes with Magento2,

but it lookes like the standard Blank Theme. No Images, no luma Content, nothing.

Is there anyone who can help? This is my theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>My Theme</title>
<parent>Magento/luma</parent>
<media>
    <preview_image>media/preview.png</preview_image>
</media>

2
  • 3
    UPDATE I opened pretty the same question at the magneto2 github. They replyed me and told me that it is not recommended to extend the luma theme anyway, because its only a demo theme even you like to have the look and feel of the luma theme.github.com/magento/magento2/issues/2547 Commented Dec 1, 2015 at 8:19
  • Did you register your theme? Commented Mar 6, 2016 at 17:01

1 Answer 1

14

along with theme.xml, you need to have below files in your custom theme, you can copy from luma and put into your custom theme and change it /app/design/frontend/Custom/default/theme.xml

<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Custom Default</title>
    <parent>Magento/luma</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

/app/design/frontend/Custom/default/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/Custom/default',
    __DIR__
);

/app/design/frontend/Custom/default/composer.json

{
    "name": "magento/theme-frontend-custom-default",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-frontend-luma": "100.0.*",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-theme",
    "version": "100.0.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}
  • along this copy etc, web, i18n and media folder from luma and paste into you custom theme
  • then clear cache and pub static folder
  • go to DB browse table called theme in that last entry will be your custom theme make sure parent id should be id of luma else delete that row and again open website

Note:- make sure in admin select your custom design and also run bin\magento setup:static-content:deploy to re-create pub static folder

1
  • 1
    how to extend all less files of luma theme? Commented Dec 27, 2018 at 8:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.