1

I'm attempting to reorder some blocks store.menu and store.links which are within the block navigation.sections like this:

vendor/magento/module-theme/view/frontend/layout/default.xml

<block class="Magento\Framework\View\Element\Template" name="navigation.sections" before="-" template="Magento_Theme::html/sections.phtml">
            <arguments>
                <argument name="group_name" xsi:type="string">navigation-sections</argument>
                <argument name="group_css" xsi:type="string">nav-sections</argument>
            </arguments>
            <block class="Magento\Framework\View\Element\Template" name="store.menu" group="navigation-sections" template="Magento_Theme::html/container.phtml">
                <arguments>
                    <argument name="title" translate="true" xsi:type="string">Menu</argument>
                </arguments>
                <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600" before="-"/>
            </block>
            <block class="Magento\Framework\View\Element\Text" name="store.links" group="navigation-sections">
                <arguments>
                    <argument name="title" translate="true" xsi:type="string">Account</argument>
                    <argument name="use_force" xsi:type="boolean">true</argument>
                    <argument name="text" xsi:type="string"><![CDATA[<!-- Account links -->]]></argument>
                </arguments>
            </block>

I want to put store.links before store.menu. To do this I've created my own default.xml at app/design/frontend/Matt/New/Magento_Theme/layout/default.xml which contains:

<move element="store.links" destination="navigation.sections" before="-"/>
<move element="store.menu" destination="navigation.sections" after="-"/>

I know that the layout file is working as I'm able to remove these blocks but for some reason the block aren't moving the html output is still:

<div class="section-item-content nav-sections-item-content" id="store.menu">
<div class="section-item-content nav-sections-item-content" id="store.links">

I can't understand why the blocks won't reorder?

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.