2

I created a custom tab in customer edit page in admin panel. It works perfectly, but I want to position the tab, so I tried to edit the customer_index_edit.xml file like below by adding:

<action method="addTabAfter">
    <argument name="after" xsi:type="string">wishlist</argument>
</action>

but it's not working and throwing an error:

[2017-10-09 05:56:42] main.CRITICAL: Invalid method vendor\module\Block\Adminhtml\Edit\Tab\Rewardpoints::addTabAfter

My customer_index_edit.xml file is below.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="customer_form">
         <block class="Vendor\Module\Block\Adminhtml\Edit\Tab\Rewardpoints" name="customer_edit_tab_rewardpoints">
            <action method="addTabAfter">
                 <argument name="after" xsi:type="string">wishlist</argument>
            </action>
         </block>   
    </referenceBlock> 
</body>
</page>

How to position the tab after wishlist tab in customer edit page in admin panel?

  • let me know if you have any issue. – Prince Patel Oct 9 '17 at 6:25
4

Add after="wishlist" in your custom link.

Your final new custom link code:

<referenceBlock name="customer_form">
     <block class="Vendor\Module\Block\Adminhtml\Edit\Tab\Rewardpoints" name="customer_edit_tab_rewardpoints" after="wishlist">
        <action method="setTabLabel">
            <argument name="label" xsi:type="string">Your Tab Label</argument>
        </action>
     </block>   
</referenceBlock> 
  • thank you for your answer. What is <argument name="path" xsi:type="string">tab/path</argument> <argument name="label" xsi:type="string">Your Tab</argument>? – Mujahidh Oct 9 '17 at 6:33
  • Check my updated answer – Prince Patel Oct 9 '17 at 6:40

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.