2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00
InvenTree/docs/docs/extend/plugins/navigation.md
Oliver 2ffd2354eb
Documentation integration (#4653)
* Add documentation under docs/ directory

* Add CI workflow for mkdocs configuration checking

* Add documentation issue template

* update pip-tools?

* Update .gitignore files

* Fix .gitignore rules

* Improve release notes page

* remove references to old repo
2023-04-22 22:40:29 +10:00

928 B

title
title
Navigation Mixin

NavigationMixin

Use the class constant NAVIGATION for a array of links that should be added to InvenTrees navigation header. The array must contain at least one dict that at least define a name and a link for each element. The link must be formatted for a URL pattern name lookup - links to external sites are not possible directly. The optional icon must be a class reference to an icon (InvenTree ships with fontawesome 4 by default).

class MyNavigationPlugin(NavigationMixin, InvenTreePlugin):

    NAME = "NavigationPlugin"

    NAVIGATION = [
        {'name': 'SampleIntegration', 'link': 'plugin:sample:hi', 'icon': 'fas fa-box'},
    ]

    NAVIGATION_TAB_NAME = "Sample Nav"
    NAVIGATION_TAB_ICON = 'fas fa-plus'

The optional class constants NAVIGATION_TAB_NAME and NAVIGATION_TAB_ICON can be used to change the name and icon for the parent navigation node.