4

In the default layout for the admin product edit page, we have an accordion style setup. This is really annoying as you have to scroll down several pages every time you want to edit an option that's not part of the General tab.

I would like to have a sidebar like on the customer edit page. Switching to "admin-2columns-left" doesn't seem to do the trick. Is there any recommended way of achieving this?

I'm using the default Magento admin theme. Not Luma. Luma is a frontend theme. I don't think the default admin theme has a name.

I'm talking about

vendor/magento/theme-adminhtml-backend
  • hi have you done this? – faizanbeg Jun 10 at 10:19
  • Nope, couldn't find a straight forward and future proof solution. – Michael Thessel Jun 17 at 18:45
0

For add Tab structure in admin form instead of collapsible structure, you have to need customization catalog_product_edit.xml and product_form.xml. also, need more customization relevant to tab structure.

To display Tab structure in admin product form you need to remove first collapsible structure argument <item name="template" xsi:type="string">templates/form/collapsible</item> and add <navContainerName>left</navContainerName> under lyout arguments. like below.

ui_component/product_form.xml

Remove this code <item name="template" xsi:type="string">templates/form/collapsible</item> from line number approx 16

Find and replace below code with existing code.

<settings>
    <reloadItem>product-details.attribute_set_id:value</reloadItem>
    <buttons>
        <button name="save" class="Magento\Catalog\Block\Adminhtml\Product\Edit\Button\Save"/>
        <button name="addAttribute" class="Magento\Catalog\Block\Adminhtml\Product\Edit\Button\AddAttribute"/>
        <button name="back" class="Magento\Catalog\Block\Adminhtml\Product\Edit\Button\Back"/>
    </buttons>
    <layout>
        <navContainerName>left</navContainerName>
        <type>tabs</type>
    </layout>
    <deps>
        <dep>product_form.product_form_data_source</dep>
    </deps>
</settings>

Then follow the column structure How to add tab structure in admin ui-component form

catalog_product_edit.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" layout="admin-2columns-left">        
</page>

Change above code with existing code.

You may get below error :

Invalid method Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery::isAjaxLoaded

Note : In the above code explanation I am sharing just idea how can you achieve these things. you have customization as per your need. Make sure do not change any code file. you have to override core file and go ahead.

Take reference from below link

I hope it helps!

  • That doesn't seem to work for me. After making the suggested changes the product edit page doesn't load anymore. I get the error: Invalid method Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery::canShowTab – Michael Thessel Apr 25 at 18:04

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.