1

I am trying to get the menu, logo and all the links in the header to appear in the same line. So far, I've managed to get the logo and menu in the same line, but for some reason, the sign-in link is not showing up. .

This is default.xml from my custom theme's Megento_Theme-

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="header.panel">
        <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
            <arguments>
                <argument name="css_class" xsi:type="string">header links</argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_img_width" xsi:type="number">148</argument>
            <argument name="logo_img_height" xsi:type="number">43</argument>
        </arguments>
    </referenceBlock>
    <move element="navigation.sections" destination="header-wrapper" after="logo" />
    <referenceContainer name="footer">
        <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="Magento_Store::switch/stores.phtml"/>
    </referenceContainer>
    <referenceBlock name="report.bugs" remove="true"/>
    <move element="copyright" destination="before.body.end"/>
</body>

What could be the reason for the sign-in link not showing up?

  • are you customizing some custom theme or creating a theme based on luma default ? – Naveed Asim Oct 22 '18 at 5:50
  • I have created a new theme based on luma default so I can mess around with it instead of the core files. – Vivek Ramasha Oct 22 '18 at 5:50
  • do you see any js error ? it seems there is some js conflict with your sign in menu item and navigation panel. because sign in loads via knockout js – Naveed Asim Oct 22 '18 at 6:05
1

I'm not sure, it will be working or not. But, it maybe helpful for you.Try to use this below code.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="top.links">
        <block class="Magento\Customer\Block\Account\Link" name="my-account-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">My Account</argument>
                <argument name="sortOrder" xsi:type="number">110</argument>
            </arguments>
        </block>
        <block class="Magento\Customer\Block\Account\RegisterLink" name="register-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">Create an Account</argument>
            </arguments>
        </block>
        <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link"
               template="Magento_Customer::account/link/authorization.phtml"/>
    </referenceBlock>
    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_img_width" xsi:type="number">148</argument>
            <argument name="logo_img_height" xsi:type="number">43</argument>
        </arguments>
    </referenceBlock>
    <move element="navigation.sections" destination="header-wrapper" after="logo" />
    <referenceContainer name="footer">
        <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="Magento_Store::switch/stores.phtml"/>
    </referenceContainer>
    <referenceBlock name="report.bugs" remove="true"/>
    <move element="copyright" destination="before.body.end"/>
</body>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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