0

I'm trying to move my customer account dropdown from the header.links to the header.

The element I'm trying to move is called customer. It's in the file app/design/frontend/Smartwave/porto/Magento_Customer/layout/default.xml The code is

  <referenceBlock name="header.links">
            <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" before="-"/>
            <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login" template="account/link/authorization.phtml"/>
        </referenceBlock>

The header container is called porto_header in app/design/frontend/Smartwave/porto/Smartwave_Porto/layout/default.xml and I'm trying to move it to before="custom_block"

the code is

            <block class="Smartwave\Porto\Block\Template" name="porto_header" template="html/header.phtml" before="main.content">
                <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
                    <arguments>
                        <argument name="css_class" xsi:type="string">header links</argument>
                    </arguments>
                </block>
                <block class="Smartwave\Porto\Block\Form\Login" name="header_customer_form_login" ifconfig="porto_settings/header/login_popup" template="Smartwave_Porto::html/login.phtml"/>
                <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/>
                <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />
                <block class="Smartwave\Porto\Block\Template" name="custom_block" template="html/header_custom_block.phtml" ifconfig="porto_settings/header/static_block" after="-"/>
            </block>
        </referenceContainer>

I'm moving it using app/design/frontend/Smartwave/porto_child/Magento_Customer/layout/default.xml

and the code is

    <body>
        <move element="customer" destination="porto_header" before="custom_block" />
    </body>

But while the element doesn't appear in its original spot anymore, it doesn't show up in the header, and when I look at the page source, I don't see the CSS classes that I expect to see for this element.

If I try to move this element to anywhere else on the page, it shows up, but when I try to move it to porto_header, it's nowhere to be found

Your Answer

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

Browse other questions tagged or ask your own question.