0

I'm trying to do some simple modification to my theme, but I can't understand why there are 2 different default.xml files, one under \vendor\magento\module-theme\view\frontend\layout\ and the other under \vendor\magento\theme-frontend-luma\Magento_Theme\layout\

If I add my default.xml under \app\design\frontend\vendor\theme\Magento_Theme\layout and the header.links block disappear.

This is my last try after dozen of it

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

<body>

<move element="top.search" destination="head.col.left" after="store_language" />
<move element="logo" destination="head.col.center" />
<move element="minicart" destination="head.col.right" />
<move element="header.panel" as="header.panel.new" destination="header.panel.wrapper" />
<move element="header.links" destination="header.panel.new" />

<referenceContainer name="top.head">
<container name="header.navi" label="Page Header Navigation top" htmlTag="div" htmlClass="container-xxl">
    <block class="Magento\Framework\View\Element\Template" name="head.top" template="Magento_Theme::html/head-top.phtml"></block>
</container>
</referenceContainer>
  
<referenceContainer name="header.container">
    <container name="header.panel.wrapper" htmlClass="middle_head" htmlTag="div" before="-">
        <container name="header.panel.new" label="Page Header Panel" htmlTag="div" htmlClass="container-xxl panel wrapper">
            <container name="middle.head.row" htmlClass="row panel header" htmlTag="div">
            
                <container name="head.col.left" htmlClass="col-4 uno" htmlTag="div" after="middle.head.row">
                    <block class="Magento\Framework\View\Element\Template" name="skip_to_content" template="Magento_Theme::html/skip.phtml">
                        <arguments>
                            <argument name="target" xsi:type="string">contentarea</argument>
                            <argument name="label" translate="true" xsi:type="string">Skip to Content</argument>
                        </arguments>
                    </block>
                    <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="Magento_Store::switch/languages.phtml">
                        <arguments>
                            <argument name="view_model" xsi:type="object">Magento\Store\ViewModel\SwitcherUrlProvider</argument>
                        </arguments>
                    </block>
                </container>
                
                <container name="head.col.center" htmlClass="col-4 due" htmlTag="div" after="head.col.left">

                </container>
                
                <container name="head.col.right" htmlClass="col-4 tre" htmlTag="div" after="head.col.center">

                </container>

            </container>
        </container>
    </container>    

</referenceContainer>  
  
</body>
</page>
1

There can be many default.xml files in your magento site, they will all be collected and merged

For your specific case, why don't you try to move this block to the end of the file, it seems like you are trying to move blocks to containers that still don't exist:

<move element="top.search" destination="head.col.left" after="store_language" />
<move element="logo" destination="head.col.center" />
<move element="minicart" destination="head.col.right" />
<move element="header.panel" as="header.panel.new" destination="header.panel.wrapper" />
<move element="header.links" destination="header.panel.new" />
1
  • Thank you, but nothing change
    – Delio
    Jul 22 '21 at 8:17

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.