How to set an active tab after hiding the first one in Magento

Recently I struggled with how to set an active tab after hiding the first one in Magento admin custom module. I wanted to have the view and edit tabs inside the same action, so that when it edits the page both view and edit are shown. When it’s a new action then only the edit tab will be shown (with corresponding title). Sadly, searching the internet gave me zero results, so it was time to make it by myself.

So, I’ve hide view tab when it’s new action:

Result:

Inactive Tab

To set this tab as active you need to add following:

And voila:

Tab set as active!

Hope that helps.


Rating:

How to set an active tab after hiding the first one in Magento
3 (60%) 1 vote[s]

What do you think?

Required fields are marked *


*