Any guidance from someone how i can add a tab with custom block to category edit page?
Thanks,
Thomas
Solved! Go to Solution.
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
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