Deployment 未部署Magento 2自定义主题
我已经为Magento 2生产版创建了自定义主题。我已经从后端选择了我的主题。但它只呈现HTML。我部署了静态内容,但我的主题不在Deployment 未部署Magento 2自定义主题,deployment,command-line,themes,file-permissions,magento2,Deployment,Command Line,Themes,File Permissions,Magento2,我已经为Magento 2生产版创建了自定义主题。我已经从后端选择了我的主题。但它只呈现HTML。我部署了静态内容,但我的主题不在 pub\static\frontend\Magento 目录,所以我得到了404的.css和.js文件。我尝试设置文件权限,但没有成功。在部署luma主题后的命令行窗口中,它将继续部署admin。感谢您的帮助 文件结构: app/design/frontend/Muaw/mytheme: |-etc | |-view.xml |-media | |-pr
pub\static\frontend\Magento
目录,所以我得到了404的.css
和.js
文件。我尝试设置文件权限,但没有成功。在部署luma主题后的命令行窗口中,它将继续部署admin。感谢您的帮助
文件结构:
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
档案:
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>
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__
);
创建您的媒体/preview.jpg
并将composer.json文件中的名称更改为Muaw/mytheme创建您的媒体/preview.jpg
并将composer.json文件中的名称更改为Muaw/mytheme
<?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__
);