2

Currently I understand the system of templates as follows:

[depends layouts]    (page_layout)
↓
layout               (page_layout)
↓
magento default.xml  (page_configuration)
↓
my theme default.xml (page_configuration)
↓
module file super-module-file.xml (page_configuration)
↓ = merge.

I have a 2 layout: narrow_page and wide_page. I want to change block "header-wrapper" depending of the layout. But currently default.xml (in magento/theme) overrides this block. I can not use my default.xml because next time this file apply for both layouts.

How I can solve this problem?

0

I temporarily solved a problem by overriding the default.xml. This is not recommended, but I feel so comfortable.

Alternative, you can use "move" for wrapping the container. For example:

page_configuration:

<container name="footer-container" htmlTag="footer" htmlClass="footer"/>

<move element="footer" destination="footer-container"/>

default.xml: (the destruction of the old container)

<referenceContainer name="footer" htmlTag="" htmlClass=""></referenceContainer>

In result:

<footer class="footer">
    [old footer - don't visible]
        content
    [/old footer]
<footer>

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.