In a standard installation of Joomla! we have several predefined Menu events which, when triggered, call functions in the associated plugins.
Allows plugins to dynamically add menu types in the menu manager
&list
A reference to the object that holds all the menu typesMenusModelMenutypes
The model instance. This is in order for functions to add their custom types to the reverse lookup (in addition to adding them in the list property) via the addReverseLookupUrl function in the model.Inside your system plugin the following code will add a custom menu type:
public function onAfterGetMenuTypeOptions(&$list, MenusModelMenutypes $model)
{
// Create a new Menu Type
// Create the menu option for the component.
$o = new JObject;
$o->title = 'Your Menu Type Title';
$o->description = 'Your Menu Type Description';
$o->request = [
'option' => 'com_foobar',
'other' => 'option'
];
$list['com_foobar'][] = $o;
$model->addReverseLookupUrl($o);
}
None. Result will be omitted.
administrator/components/com_menus/models/menutypes.php