1

I want to build my first theme for Magento but get stuck at the setup. I made a directory in the app -> design -> frontend -> called myfirsttheme and in this folder I made one called myfirsttheme.

Here I created the files theme.xml:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>MyFirstTheme</title>
<parent>Magento/Luma</parent>
<media>
    <preview_image>media/theme-image.jpg</preview_image>
</media>

composer.json :

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

and 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/myfirsttheme/myfirsttheme',
    __DIR__
);

When I open the backend I get the message:

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 98616252

After removing the registration.php the message is gone and I can login. But I can't install the theme. What's going wrong?

4
  • What's the error in 98616252 ? Sep 22, 2016 at 10:29
  • check ... <theme> tag not closed in your xml Sep 22, 2016 at 10:44
  • got to var/report/98616252 and add error message too.. Sep 22, 2016 at 11:35
  • How about this issue? Feb 19, 2017 at 11:14

2 Answers 2

0

Please check in registration.php you need to write something like this.

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'YourPackageName_YourModuleName',
    __DIR__
);

And then check. I think this is mistake you done.

Hope this will help you.
Thanks

0

In your case, I think you're missing the preview image. Try to add this file: app/design/frontend/myfirsttheme/myfirsttheme/media/theme-image.jpg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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