2016-03-04 21 views
2

我已經創建了這些目錄。 -app - 設計 -frontend -vendor -theme -theme.xml - 媒體 -preview.jpg如何在Magento 2中創建新主題

主題裝入bacend設計列表,但是當我激活它,然後有上顯示什麼前端

回答

1

我更喜歡看這些答案。

app/design/frontend/Magento/mytheme/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> 
</theme> 

app/design/frontend/Magento/mytheme/composer.json

{ 
    "name": "magento/theme-frontend-blank", 
    "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" 
     ] 
    } 
} 

app/design/frontend/Magento/mytheme/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/Magento/mytheme', 
    __DIR__ 
); 

https://magento.stackexchange.com/questions/94541/theme-is-not-showing-in-admin-panel-list-magento2/94546#94546

+0

I HV所做的這一切,但是當我從配置調試,然後沒有文件顯示從應用程序/設計所有文件來自供應商/設計/或在某些情況下應用程序/代碼/設計/ – atifaltaf

+0

'bin/php bin/magento setup:static-content:deploy'你部署內容? –

+0

是的,我做到了,但沒有改變。 – atifaltaf