Extend PluginTemplateExtension to render custom alerts for objects #9923

Closed
opened 2025-12-29 21:24:28 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jul 1, 2024).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v4.0.6

Feature type

New functionality

Proposed functionality

Add a new render_alerts() method on PluginTemplateExtension, which returns an iterable of alerts to be displayed at the top of the page when viewing an object. Each item in the iterable will be a two-tuple containing the message content and classification (e.g. info, warning, etc.).

Use case

This will enable a plugin to embed arbitrary notes or alerts pertaining to specific objects within NetBox. For example, it might be used by a plugin to indicate that a certain object is out of sync with external data or that some action is required to rectify a problem.

Database changes

None

External dependencies

None

Originally created by @jeremystretch on GitHub (Jul 1, 2024). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v4.0.6 ### Feature type New functionality ### Proposed functionality Add a new `render_alerts()` method on PluginTemplateExtension, which returns an iterable of alerts to be displayed at the top of the page when viewing an object. Each item in the iterable will be a two-tuple containing the message content and classification (e.g. info, warning, etc.). ### Use case This will enable a plugin to embed arbitrary notes or alerts pertaining to specific objects within NetBox. For example, it might be used by a plugin to indicate that a certain object is out of sync with external data or that some action is required to rectify a problem. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 21:24:28 +01:00
adam closed this issue 2025-12-29 21:24:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9923