0

I installed magento 2 and successfully implemented custom theme.

I used magento blank as my theme's parent theme. I'm new to magento, so this may seem like a stupid question, but please help me without actually down-voting or locking this question.

My problem is, how do I change the storefront look in my theme? All I get is usual Magento 2 page with only my logo in it.

  • How do I edit header section?
  • Which files I may need to edit or add?
  • I need to edit top links section (usually contains links like sign in, my account, register)?

Please help.

2

1 Answer 1

0

http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-general.html All info you need will be here

Copy vendor/magento/module-theme/view/frontend/templates/html/header.phtml to you theme directory app/design/frontend/Vendor/themename/Magento_Theme/templates/html/header.phtml (path will same in magento_theme) This will override original by your template header when your theme loaded

Add new link to top. Put this code to anyfile layout in your theme. This block top.links only exist in theme-blank

<referenceBlock name="top.links">
        <block class="Magento\Framework\View\Element\Html\Link"  name="test-link" after="-" cacheable="false">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">Test</argument>
                <argument name="css_class" xsi:type="string">test-link</argument>
            </arguments>
        </block>
    </referenceBlock>
3
  • Hi , thanks for you take time for my question. im not little bit unclear on last part of the answer. Do I need to put above code into my header.phtml file or in some xml file? im not clear on adding stuff. heard there are 2 ways of adding data into magento theme. one is using backend and linking to phtml files and other one is not using backend but use only xml and phtml files. this is the place Im stuck at.. Sorry if I make this worse
    – Vishwa
    Commented Jun 5, 2017 at 5:25
  • it depends on your requirement. But i think layout way will help you for common demands
    – mrtuvn
    Commented Jun 5, 2017 at 16:34
  • you mean with xml editing right? thing is I have very low knowledge on how to do that. magento devdocs are not helpful. if you can please help me with that.. i need something to learn how to customize theme with xml files and backend. i searched google,a lot. but still couldn't find something good
    – Vishwa
    Commented Jun 6, 2017 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.