2016-10-17 19 views
0

ヘッダーに画像を追加する方法320x72(heightxwidth)をmagentoで追加する方法2.ヘッダーとフッターのファイルとapp-> design-> frontend->またはshopping \ vendor \ magento \ themeに表示する方法-frontend-blank \ Magento_Theme \ layoutと入力します。私は段階的に変更を提案します。ヘッダーmagentoに広告イメージを追加する方法2

+0

Stack Overflowは[プログラミング関連](http://stackoverflow.com/help/on-topic)のQ&Aサイトであるため、このトピックをオフトピックとして閉じることにしました。あなたの質問はプログラミングに関するものではありません。おそらくあなたは代わりにhttp://magento.stackexchange.comに投稿する必要がありますか? – Enigmativity

答えて

0

ステップ1 Magentoの中で新しいテーマを作る2次アプリ/設計/フロントエンド/// Magento_Theme /テンプレート/ htmlの

ディレクトリ以下

ステップ2.コピーしheader.phtmlファイルベンダーの\ Magentoのから\ module-theme \ view \ frontend \ templates \ htmlに貼り付けてapp/design/frontend// Magento_Theme/templates/htmlに貼り付けてください。

ステップ3.これでheader.phtmlファイルを変更できます。

Image can add in header by below code. 

<?php 
     $_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); 

     $storeManager = $_objectManager->get('Magento\Store\Model\StoreManagerInterface'); 

     $currentStore = $storeManager->getStore(); 

     $mediaUrl = $currentStore->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA); 
    ?> 

    <img scr="<?php echo $mediaUrl.'/image.jpg' ?>"> 
関連する問題