Allow Plugins to inject CSS or Javascript to HEAD section #16630
Labels
complexity: low
Requires minimal effort to implement
netbox
status: accepted
This issue has been accepted for implementation
topic: plugins
Relates to the plugins framework
type: feature
Introduction of new functionality to the application
Milestone
NetBox version
v4.0.5
Feature type
Data model extension
Proposed functionality
Provide a mean for a plugin to add its own content into the HEAD section of the page
This will make the CSS and Javascript available on all pages loaded.
netbox/templates/base/base.html
{% load plugins %}
{% plugin_base_head object %}
netbox/utilities/templatetags/plugins.py
def plugin_base_head(context, obj):
netbox/netbox/plugins/templates.py
class PluginTemplateExtension
withdef base_head(self)
Use case
Some plugins want to add content to all pages.
I'm using the 'BANNER_BOTTOM' to do this, and in newer version the middleware technique.
It would however be convenient for the plugin to have a native way to inject the JS and CSS.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: