D
D
Denis Belevtsov2017-04-21 23:08:21
Magento
Denis Belevtsov, 2017-04-21 23:08:21

Magento 2, creating a theme?

Created basic theme files according to the documentation. After applying a theme, many resources do not load on page load. Why? Unless, if they are absent in the theme, they should not be taken from the parent one (in this case, "Magento/blank").
php bin/magento setup:static-content:deploy - executed, cleared the cache.
"Current application mode: developer."

File structure
739ef64041214ad2897626bd4ae48ce6.png
theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>myTheme</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.jpeg</preview_image> <!-- the path to your theme's preview image -->
    </media>
</theme>

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/myVendor/myTheme',
    __DIR__
);
Screen/console
a72f44c39f8141c695194a6873eb6aa9.png

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
imdeveloper, 2017-04-23
@link_web

A similar issue has been discussed here.
When deploying static content, make sure that the console does not give any errors and I recommend that you always check the rights and folders of the generated files so that their owner matches the owner of the site files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question