Jump to content
Sign in to follow this  
NiteFox

Creating Plugin Tabs Help

Recommended Posts

Afternoon,

I am playing around with creating a plugin and have read the example guide but seem to have come stuck on creating tabs on the plugin page.

Current structure is based on the Visitor Stat Example so you have the main settings page, then a new menu section and child link to a new page in the left-hand menu.

Now when clicking the child link it loads the new page to list the content i want from the DB but theres no content in the tabs bar above the page content and not sure on how to create tabs as thats not covered in the guide. I know theres the admin.tabs hook but not 100% if/how i should be utilising that hook.

So was wondering if anyone can shed some light on this?

Cheers :)

 

 

Share this post


Link to post
Share on other sites

Posted (edited)

I would recommend not using the admin.tabs hook. This seems to be best used if one needs to modify an existing tab(s) that are ready to be displayed. This could sometimes include adding more or deleting some tabs from an existing admin function (such as adding/editing an item of inventory).

If your plugin is creating an entirely new admin feature (not enhancing any other administrative task), and because plugin modules can have their own admin control panels (/skin/admin/index.tpl) with corresponding controller code (/admin/index.inc.php), perhaps using ACP->addTabControl() would work better.

But if your plugin is enhancing an existing feature/function, and need to include your relevant tabs (for the corresponding panels of settings), then the admin feature you are modifying may have a specific hook to use (such as editing a product -- admin.product.tabs) where the addTabControl() call would be placed.

Edited by bsmither
  • Thanks 1

Share this post


Link to post
Share on other sites
50 minutes ago, bsmither said:

I would recommend not using the admin.tabs hook. This seems to be best used if one needs to modify an existing tab(s) that are ready to be displayed. This could sometimes include adding more or deleting some tabs from an existing admin function (such as adding/editing an item of inventory).

If your plugin is creating an entirely new admin feature (not enhancing any other administrative task), and because plugin modules can have their own admin control panels (/skin/admin/index.tpl) with corresponding controller code (/admin/index.inc.php), perhaps using ACP->addTabControl() would work better.

But if your plugin is enhancing an existing feature/function, and need to include your relevant tabs (for the corresponding panels of settings), then the admin feature you are modifying may have a specific hook to use (such as editing a product -- admin.product.tabs) where the addTabControl() call would be placed.

Hey, 

Bingo! addTabControl() is what i was looking for thanks 👍

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...