0

How can I add a static block to the top header in Luma theme (see screenprint) ?

enter image description here

1

app/design/frontend/[Package]/[Theme]/Magento_Theme/layout/default.xml

 <referenceContainer name="header.panel">
    <block class="Magento\Cms\Block\Block" name="header.promotion.message">
        <arguments>
            <argument name="block_id" xsi:type="string">header_promotion_message</argument>
        </arguments>
    </block>
</referenceContainer>

<move element="header.promotion.message" destination="header.panel" before="-"/>

Note: header_promotion_message is your Block Id

enter image description here

Hope this will help you. thanks

0

Add below code at after top.search referenceContainer:

app/code/design/frontend/[Package]/[Theme]/Magento_Search/layout/default.xml

    <referenceContainer name="header-wrapper">
        <block class="Magento\Cms\Block\Block" name="Promo">
            <arguments>
                <argument name="block_id" xsi:type="string">topPromo</argument>
            </arguments>
        </block>
    </referenceContainer>

Note: Need to change block id topPromo with your block Id and need some CSS for positioning.

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.