We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Add publish tab with custom name?

Development and Programming

Fred Boyle's avatar
Fred Boyle
73 posts
15 years ago
Fred Boyle's avatar Fred Boyle

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?

       
Fred Boyle's avatar
Fred Boyle
73 posts
15 years ago
Fred Boyle's avatar Fred Boyle

I’ve also attempted the following with no success:

$tabs['tab name']['_tab_title'] = "My Custom Tab Name or Label";

Still seeking a solution.

       
oi_antz's avatar
oi_antz
1 posts
15 years ago
oi_antz's avatar oi_antz
I’ve also attempted the following with no success:
$tabs['tab name']['_tab_title'] = "My Custom Tab Name or Label";
Still seeking a solution.

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.

       
blueAlien's avatar
blueAlien
11 posts
15 years ago
blueAlien's avatar blueAlien

Quick note on the saved layouts and custom tabs…

Sometimes when you have a saved layout before you install a module that adds a custom tab to the publish page, EE2 will throw a PHP error. I am working through this now and will hopefully find what is causing this problem.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.