Hook: admin_menu_tools
avatar
Señor FAQ

¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.


Hook: admin_menu_tools

The admin_menu_tools hook allows developers to add or modify menu items in the "Tools" dropdown menu of the admin interface.

Usage


renderDropdownMenu(
    'tools', 
    'fas fa-puzzle-piece', 
    $lang['tools'], 
    $jkv['theme_admin'], 
    [
        ['url' => DynamicRewrite::parseUrl('templates'), 'label' => $lang['templates'], 'page' => 'templates'],
        ['url' => DynamicRewrite::parseUrl('languages'), 'label' => $lang['language'], 'page' => 'languages']
    ], 
    'admin_menu_tools'
);
    

This hook ensures flexibility for adding tools-related options to the "Tools" dropdown.

Example Implementation


DynamicHooks::addHook('admin_menu_tools', function () {
    return [
        ['url' => '/custom-tools', 'label' => 'Custom Tools']
    ];
}, 'tools_plugin_namespace');
    

Best Practices

  • Group menu items logically to maintain clarity in the tools dropdown.
  • Ensure URLs and labels are functional and descriptive.
  • Test tools-related menu items to ensure proper behavior.

Troubleshooting

  • Verify that the hook is correctly registered with the namespace.
  • Check for conflicts with other plugins modifying the "Tools" menu.
Was this article helpful?
0 out of 0 found this helpful