Rename PluginNavMenuLink to PluginMenuItem
This commit is contained in:
@@ -281,14 +281,14 @@ With these three components in place, we can request `/api/plugins/animal-sounds
|
||||
|
||||
## Navigation Menu Items
|
||||
|
||||
To make its views easily accessible to users, a plugin can inject items in NetBox's navigation menu under the "Plugins" header. Menu items are added by defining a list of PluginNavMenuLink instances. By default, this should be a variable named `menu_items` in the file `navigation.py`. An example is shown below.
|
||||
To make its views easily accessible to users, a plugin can inject items in NetBox's navigation menu under the "Plugins" header. Menu items are added by defining a list of PluginMenuItem instances. By default, this should be a variable named `menu_items` in the file `navigation.py`. An example is shown below.
|
||||
|
||||
```python
|
||||
from extras.plugins import PluginNavMenuButton, PluginNavMenuLink
|
||||
from extras.plugins import PluginNavMenuButton, PluginMenuItem
|
||||
from utilities.choices import ButtonColorChoices
|
||||
|
||||
menu_items = (
|
||||
PluginNavMenuLink(
|
||||
PluginMenuItem(
|
||||
link='plugins:netbox_animal_sounds:random_sound',
|
||||
link_text='Random sound',
|
||||
buttons=(
|
||||
@@ -299,7 +299,7 @@ menu_items = (
|
||||
)
|
||||
```
|
||||
|
||||
A `PluginNavMenuLink` has the following attributes:
|
||||
A `PluginMenuItem` has the following attributes:
|
||||
|
||||
* `link` - The name of the URL path to which this menu item links
|
||||
* `link_text` - The text presented to the user
|
||||
|
Reference in New Issue
Block a user