Jump to content

Creating Plugin Tabs Help


NiteFox

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 :)

 

 

Link to comment
Share on other sites

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.

Link to comment
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 👍

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...