2017-12-13 12 views
0

Magento2.2を初めて使用しています。私はMagneto Blank Theme.phtmlファイルを上書きしようとしましたが、私は以下のことを行っています。Magento 2.2:反映されない.phtmlファイルをオーバーライドします。

ブランクテーマファイルパス /Magento-Dir/vendor/magento/module-theme/view/frontend/templates/html/title.phtml

マイファイルパス アプリ/設計/フロントエンド/MyTheme/Acorn/module-theme/template/html/title.phtml

マイファイル

<?php 
/** 
* Copyright © Magento, Inc. All rights reserved. 
* See COPYING.txt for license details. 
*/ 

// @codingStandardsIgnoreFile 

/** 
* @var $block \Magento\Theme\Block\Html\Title 
*/ 
$cssClass = $block->getCssClass() ? ' ' . $block->getCssClass() : ''; 
$title = ''; 
if (trim($block->getPageHeading())) { 
    $title = '<span class="base" data-ui-id="page-title-wrapper" ' . $block->getAddBaseAttribute() . '>' 
     . $block->escapeHtml($block->getPageHeading()) . '</span>'; 
} 
?> 
<?php if ($title): ?> <h1>Test Text</h1> 
<div class="page-title-wrapper<?= /* @escapeNotVerified */ $cssClass ?>"> 
    <h1 class="page-title" 
     <?php if ($block->getId()): ?> id="<?= /* @escapeNotVerified */ $block->getId() ?>" <?php endif; ?> 
     <?php if ($block->getAddBaseAttributeAria()): ?> 
      aria-labelledby="<?= /* @escapeNotVerified */ $block->getAddBaseAttributeAria() ?>" 
     <?php endif; ?>> 
     <?= /* @escapeNotVerified */ $title ?> 
    </h1> 
    <?= $block->getChildHtml() ?> 
</div> 
<?php endif; ?> 

この後、php bin/magento setup:static-content:deploy -fのpub/static/frontendフォルダを削除してから、自分のページを再読み込みしました。それでも、空のテーマファイルを指しています。

私は私がここで行われているミスをしないでください http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/templates/template-walkthrough.html

に従った、間違いを見つけるためのお手伝いをしてください。

答えて

0

ファイルのパスが正しくありません。このファイルを下のパスで上書きしてください。

アプリ/設計/フロントエンド/ MyTheme /どんぐり/ Magento_Theme /テンプレート/ HTML/title.phtml

関連する問題