Changeable class on banner bar #5569

Closed
opened 2025-12-29 19:29:37 +01:00 by adam · 2 comments
Owner

Originally created by @hagbarddenstore on GitHub (Oct 27, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.0.8

Feature type

Change to existing functionality

Proposed functionality

Be able to change either the rendered template of the top/bottom banner or be able to set the classes it's rendered with. The cyan colour might not be what's wanted/needed for that banner.

Use case

We use the banner to differentiate between development and production environments, where different production environments may contain information that's classified differently. It would be very helpful to further visualise the "danger" of each system by changing the background colour of the banners.

Database changes

None

External dependencies

None

Originally created by @hagbarddenstore on GitHub (Oct 27, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.0.8 ### Feature type Change to existing functionality ### Proposed functionality Be able to change either the rendered template of the top/bottom banner or be able to set the classes it's rendered with. The cyan colour might not be what's wanted/needed for that banner. ### Use case We use the banner to differentiate between development and production environments, where different production environments may contain information that's classified differently. It would be very helpful to further visualise the "danger" of each system by changing the background colour of the banners. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 19:29:37 +01:00
adam closed this issue 2025-12-29 19:29:37 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 27, 2021):

It probably makes the most sense to allow the user to toggle wrapping the banner content in the blue block. This could be done either with a separate config parameter (to control the top, bottom, and login banners), or via some autodetection method on the content itself. For instance, if the banner content starts with an HTML tag, forgo the wrapper.

@jeremystretch commented on GitHub (Oct 27, 2021): It probably makes the most sense to allow the user to toggle wrapping the banner content in the blue block. This could be done either with a separate config parameter (to control the top, bottom, and login banners), or via some autodetection method on the content itself. For instance, if the banner content starts with an HTML tag, forgo the wrapper.
Author
Owner

@jeremystretch commented on GitHub (Dec 13, 2021):

The simplest approach here is probably to just remove the hard-coded <div> element surrounding the banner content. For instance:

{% if config.BANNER_TOP %}
    {{ config.BANNER_TOP|safe }}
{% endif %}
@jeremystretch commented on GitHub (Dec 13, 2021): The simplest approach here is probably to just remove the hard-coded `<div>` element surrounding the banner content. For instance: ``` {% if config.BANNER_TOP %} {{ config.BANNER_TOP|safe }} {% endif %} ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5569