设置Magento主题时出现问题



我只是在尝试设置一个Magento主题,事实证明这对我来说比我想象的要困难得多。

  • 我创建了一个模板(只是根据文档和徽标的定义文件.svg(。
  • 我制作了我的模板以继承Luma(Magento/luma(。
  • 我的模板显示在主题部分,我将主题设置为在内容部分使用。
  • 然后商店突然看起来像Magento/空白主题......

为什么它看起来不像Luma主题,尽管Magento正确地列出了我的主题,因为Luma是其父主题?为什么我的自定义徽标没有按预期显示?到目前为止,我的文件结构看起来只是(在应用程序/设计/前端/测试/我的主题/中(

composer.json
registration.php
theme.xml
web
css
style.css
images
logo.svg

主题.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/luma</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
</theme>

此外,徽标也应该显示,但不显示。

在Magento应用程序中,徽标的默认格式和名称 图像是徽标.svg。当你把一个标志.svg图像放在传统的 位置,即/web/images 目录,它是 自动识别为主题徽标。它显示在您的商店中 应用主题后的页眉。 (来自: https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-create.html(

顺便说一句:梅真托CE 2.2.6

缓存被刷新并应用新的主题设置,即当我切换主题时。

从 CLI 运行这些命令。

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

最新更新