cancel
Showing results for 
Search instead for 
Did you mean: 

How to add tab to category edit page in backend

SOLVED

How to add tab to category edit page in backend

Any guidance from someone how i can add a tab with custom block to category edit page?

 

Thanks,

Thomas 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to add tab to category edit page in backend

 

namespace Vendor\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer as EventObserver;

class AddTabsObserver implements ObserverInterface
{
    protected $_layout;
    protected $_logger;

    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Psr\Log\LoggerInterface $logger
    )
    {
        $this->_layout = $context->getLayout();
        $this->_logger = $logger;
    }

    public function execute( EventObserver $observer )
    {
        $tabs = $observer->getEvent()->getData('tabs');
        $tabs->addTab('features', array(
            'label'     => __('Feature Products'),
            'content'   => 'Feature Products'
        ));
        return $this;
    }
}

 

In case someone else struggles with it... Just add an event.xml for "

adminhtml_catalog_category_tabs

View solution in original post

2 REPLIES 2

Re: How to add tab to category edit page in backend

 

namespace Vendor\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer as EventObserver;

class AddTabsObserver implements ObserverInterface
{
    protected $_layout;
    protected $_logger;

    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Psr\Log\LoggerInterface $logger
    )
    {
        $this->_layout = $context->getLayout();
        $this->_logger = $logger;
    }

    public function execute( EventObserver $observer )
    {
        $tabs = $observer->getEvent()->getData('tabs');
        $tabs->addTab('features', array(
            'label'     => __('Feature Products'),
            'content'   => 'Feature Products'
        ));
        return $this;
    }
}

 

In case someone else struggles with it... Just add an event.xml for "

adminhtml_catalog_category_tabs

Re: How to add tab to category edit page in backend

See this tutorial, I hope you to get the results.

screenshot.png

https://www.youtube.com/watch?v=xmpFEzKfiqA