0

As the title says, how can I reference a layout block which doesn't have a "name" or "as" attrbitue?

Specifically, I'm trying to reference the Customer Account menu and add a title argument in customer_account.xml.

Here's the title argument which I'm trying to add:

<argument name="block_title" xsi:type="string">User account</argument>

to:

<block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/collapsible.phtml" before="-">
    <arguments>
        <argument name="block_css" xsi:type="string">account-nav</argument>
    </arguments>
    ... more code here ...
</block>

Not sure how to go about this, except to edit the vendor customer_account.xml. Which is something I'd rather not do...

1 Answer 1

0

This has been fixed in Magento 2.2.

The customer account navigation container block now has the name sidebar.main.account_nav and can be referenced.

<referenceContainer name="sidebar.main">
     <block class="Magento\Framework\View\Element\Template" name="sidebar.main.account_nav" template="Magento_Theme::html/collapsible.phtml" before="-">
     <arguments>
          <argument name="block_css" xsi:type="string">account-nav</argument>
     </arguments>
          <block class="Magento\Customer\Block\Account\Navigation" name="customer_account_navigation" before="-">
          ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.