0

I'm starting my first foray into developing a theme for Magento 2 and currently it's not listing my theme when I go to Stores > General > Design, only Luma and Blank.

I have set up the theme with the directory structure as outlined here and added an entry for the theme in dev/tools/grunt/configs/registration.php

Does anyone have any advice?

3 Answers 3

1

Make sure that your Magento application is in developer mode.

php bin/magento deploy:mode:set developer

create folder structure and place 2 files in theme root:

app/design/frontend/[vendor]/[theme]/

registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/[vendor]/[theme]',
__DIR__
);

theme.xml

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

Apply your theme: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-apply.html

Delete all files in the pub/static/frontend and var/view_preprocessed directories.

Deploy static resources (SSH to magento root)

php bin/magento setup:static-content:deploy

Clear cache and reload.

3
  • In registration.php do I change the THEME in \Magento\Framework\Component\ComponentRegistrar::THEME, to my theme name?
    – evilscary
    Commented Apr 5, 2016 at 16:14
  • No just replace [vendor] & [theme] with the path to your theme
    – Joshua34
    Commented Apr 5, 2016 at 16:16
  • I wasn't in developer mode. Thanks so much!
    – evilscary
    Commented Apr 5, 2016 at 16:24
1

It should be there automatic. Check for typing mistakes.

Clear Caches... switch to developer mode:

./bin/magento deploy:mode:set developer
0

Try to upgrade your magento setup. You need to run the following command to update the database schema.

bin/magento setup:upgrade

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.