1

I have created a custom theme for Magento 2 production version. I have selected my theme from the back-end. But it renders only HTML. I deployed the static content but my theme is not in the

pub\static\frontend\Magento

directory so I get 404 for .css and .js files. I have tried setting file permissions but no luck. In the command line window after deploying luma theme it continues to deploy admin. Any help is appreciated.

file structure:

app/design/frontend/Muaw/mytheme:

|-etc
|   |-view.xml
|-media
|   |-preview.png
|-registration.php
|-theme.xml
|-composer.json
|-web
|   |-css
|   |-js
|   |-fonts
|   |-images
|-Magento_Theme
|   |-layout
|   |   |-default.xml

Files:

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> <!-- 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>

composer.json:

{
"name": "magento/theme-frontend-luma",
"description": "N/A",
"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/theme-frontend-blank": "100.0.*",
    "magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "100.0.1",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"autoload": {
    "files": [
        "registration.php"
    ]
}
}

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/Muaw/mytheme',
        __DIR__
    );

Thanks in advance. :)

2

your parent theme name is <parent>Magento/blank</parent>

so change this "name": "magento/theme-frontend-luma",

to

"name": "magento/theme-frontend-blank",

check this link

1

"name": "magento/theme-frontend-luma" in the composer.json should be changed to your theme name?

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.