2016-10-12 33 views
0

我从头开始创建一个新的主题为magento 2,我已经为它创建了必要的文件。但是当我打开管理潘内尔它给错误,错误日志显示以下错误“主题的关键不符合要求的格式”Magento主题的关键不符合要求的格式

我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-> DES ign-> frontend-> wpiinc-> wpiinc

我该如何解决这个错误? 当我运行php bin/magento setup:static-content:deploy这个命令我得到了下面的错误命令提示符 “主题的关键不符合要求的格式‘区域/供应商/名称’”

请帮

回答

0

转到管理面板, 和禁用整个页面缓存通过以下步骤 系统 - >缓存管理 - >设置页面缓存并将其禁用 冲洗缓存后

稍后通过此命令检查您的模式。 PHP斌\ Magento的部署:模式:显示

如果模式是“默认”,那么它通过这个命令 PHP斌\ Magento的部署转化为开发者模式:模式:集开发

而在最后一次尝试修改通过在标题标签后添加 Magento/blank来添加theme.xml文件。

0

<?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__ 
); 
更换registration.php的代码