0

I need wrapper into a new div the block help create in the header.panel. I wrapped the block header-links in the new div and work, but the link custom doesn't wrapper in other div.

This is the code of my default.xml

    <referenceContainer name="header.panel">

        <block class="Magento\Framework\View\Element\Html\Link\Current" name="help" before="div.login.menu">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">help</argument>
                <argument name="path" xsi:type="string">help</argument>
            </arguments>
        </block>

        <block class="Magento\Framework\View\Element\Html\Link\Current" name="navbar.brand">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">HOME</argument>
                <argument name="path" xsi:type="string"></argument>
            </arguments>
        </block>

        <container name="div.login.menu" htmlTag="div" htmlClass="login-menu" after="-">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
            </block>
        </container>

        <container name="div.navbar.brand" htmlTag="div" htmlClass="navbar-brand" after="">
            <block class="Magento\Framework\View\Element\Html\Current" name="navbar.brand">
            </block>
        </container>

    </referenceContainer>

I need wrapper the block help and the block navbar.brand in.

The result of my default.xml is this

<div class="panel header">
    <li class="nav item"><a href="">help</a></li>
    <li class="nav item"><a href="">HOME</a></li>

    <div class="login-menu">
    <ul>
        <li><a href="">Account</a></li>
    </ul>
    </div>
</div>

The wrapper of the header.links work, but the wrapper of the navbar.brand doesn't work.

Please, help me.

1

I fix my problem.

        <container name="helplink.container" as="helplinkContainer" label="helplink Container" htmlTag="div" htmlClass="help-link">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="linkhelp" after="top-search">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">help</argument>
                    <argument name="path" xsi:type="string">carvoe-help</argument>
                </arguments>
            </block>
        </container>

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.