I’ve written a simple add-on and it has a tab for the publish form. My problem is that I seem unable to change the name of the tab that is created. It refuses to be anything other than the name of the class.
I’m using the guidelines provided in the developer docs.
$this->EE->layout->add_layout_tabs($tabs, 'My Tab Name');That doesn’t affect anything, and the second argument for add_layout_tabs shown in the tutorial and module dev docs seems to be undocumented.
Attempting to change my tabs settings array returned by the tags method in my upd file also fails similarly.
$tabs['My Tab Name'] = array(...);What am I doing wrong or is this a bug?
I’ve also attempted the following with no success:Still seeking a solution.$tabs['tab name']['_tab_title'] = "My Custom Tab Name or Label";
I found a solution to the naming today, you have to save a layout first. On the Content > Publish > (your channel) tab, slide-out the toolbar and scroll down, check the the user groups and click “save layout”. Then reinstall the module and add an entry in the lang file exactly the same name as your module key (all lowercase):
module_lang.php
$lang['my_module'] = 'A Custom Tab!';That got it working for me, but I haven’t managed to get multiple tabs working from the same module. At this stage I don’t really need to spend time trying to get that working, it would be faster to just make another module. Let us know if you find a more detailed tutorial that shows how to do this.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.