Magento 主题的密钥不符合要求的格式
Magento Theme's key does not correspond to required format
我正在为 magento 2 从头开始创建一个新主题,我已经为它创建了必要的文件。但是当我打开管理面板时出现错误,错误日志显示以下错误 "Theme's key does not correspond to required format"
我的theme.xml代码:
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>WPIINC</title> <!-- your theme's name -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>
composer.json代码:
{
"name": "wpiinc/wpiinc",
"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,
'wpiinc/wpiinc',
__DIR__
);
文件夹结构为app->design->frontend->wpiinc->wpiinc
我该如何解决这个错误?
当我 运行 php bin/magento setup:static-content:deploy
这个命令时,我在 cmd 提示符下出现以下错误
"Theme's key does not correspond to required format 'area/vendor/name'"
请帮忙
转到管理面板,
并通过以下方式禁用整页缓存
系统 -> 缓存管理 -> 设置页面缓存并禁用它
之后刷新缓存
稍后通过此命令检查您的模式。
php bin\magento deploy:mode:show
如果模式为'default'则通过此命令将其转换为开发者模式
php bin\magento deploy:mode:set 开发者
最后尝试通过添加修改 theme.xml 文件
Magento/blank 在标题标签之后。
请将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/wpiinc/wpiinc',
__DIR__
);
我正在为 magento 2 从头开始创建一个新主题,我已经为它创建了必要的文件。但是当我打开管理面板时出现错误,错误日志显示以下错误 "Theme's key does not correspond to required format"
我的theme.xml代码:
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>WPIINC</title> <!-- your theme's name -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>
composer.json代码:
{
"name": "wpiinc/wpiinc",
"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,
'wpiinc/wpiinc',
__DIR__
);
文件夹结构为app->design->frontend->wpiinc->wpiinc
我该如何解决这个错误?
当我 运行 php bin/magento setup:static-content:deploy
这个命令时,我在 cmd 提示符下出现以下错误
"Theme's key does not correspond to required format 'area/vendor/name'"
请帮忙
转到管理面板, 并通过以下方式禁用整页缓存 系统 -> 缓存管理 -> 设置页面缓存并禁用它 之后刷新缓存
稍后通过此命令检查您的模式。 php bin\magento deploy:mode:show
如果模式为'default'则通过此命令将其转换为开发者模式 php bin\magento deploy:mode:set 开发者
最后尝试通过添加修改 theme.xml 文件 Magento/blank 在标题标签之后。
请将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/wpiinc/wpiinc',
__DIR__
);