Rename PluginNavMenuLink to PluginMenuItem

This commit is contained in:
Jeremy Stretch
2020-03-26 11:29:05 -04:00
parent 81c9177c09
commit 40574b65af
2 changed files with 8 additions and 8 deletions

View File

@@ -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