Allow the "markdown" template filter to add css class names to the rendered div class attribute #8270

Closed
opened 2025-12-29 20:34:32 +01:00 by adam · 4 comments
Owner

Originally created by @jsenecal on GitHub (Jun 29, 2023).

NetBox version

v3.5.4

Feature type

Change to existing functionality

Proposed functionality

As implemented in 3e852acc8e, this would allow the div generated by the markdown template filter to have additional custom classes appended to the list of classes.

Use case

This extends usability of the template filter for use cases where one needs to add CSS classes in a specific rendering context.

Database changes

None

External dependencies

None

Originally created by @jsenecal on GitHub (Jun 29, 2023). ### NetBox version v3.5.4 ### Feature type Change to existing functionality ### Proposed functionality As implemented in https://github.com/netbox-community/netbox/pull/12664/commits/3e852acc8ec48f5b7d32811f4d9dec0ccdfa5970, this would allow the `div` generated by the `markdown` template filter to have additional custom classes appended to the list of classes. ### Use case This extends usability of the template filter for use cases where one needs to add CSS classes in a specific rendering context. ### Database changes None ### External dependencies None
adam added the type: featuretopic: UI/UX labels 2025-12-29 20:34:32 +01:00
adam closed this issue 2025-12-29 20:34:33 +01:00
Author
Owner

@jsenecal commented on GitHub (Jun 29, 2023):

This FR is related to #12664

@jsenecal commented on GitHub (Jun 29, 2023): This FR is related to #12664
Author
Owner

@jeremystretch commented on GitHub (Aug 17, 2023):

This extends usability of the template filter for use cases where one needs to add CSS classes in a specific rendering context.

Can you cite an instance where this is needed, and wrapping the Markdown content in another <div> isn't sufficient? It feels like this should be handled in the template.

@jeremystretch commented on GitHub (Aug 17, 2023): > This extends usability of the template filter for use cases where one needs to add CSS classes in a specific rendering context. Can you cite an instance where this is needed, and wrapping the Markdown content in another `<div>` isn't sufficient? It feels like this should be handled in the template.
Author
Owner

@jsenecal commented on GitHub (Aug 17, 2023):

Can you cite an instance where this is needed, and wrapping the Markdown content in another <div> isn't sufficient? It feels like this should be handled in the template.

When rendering markdown widgets, this is required to address #13079 as the look and feel is inconsistent without adding a class to the rendered div (which uses the generic widget template, in that use-case)

I guess it's dependant on the acceptation of that other FR as it is related.

@jsenecal commented on GitHub (Aug 17, 2023): > Can you cite an instance where this is needed, and wrapping the Markdown content in another `<div>` isn't sufficient? It feels like this should be handled in the template. When rendering markdown widgets, this is required to address #13079 as the look and feel is inconsistent without adding a class to the rendered div (which uses the generic widget template, in that use-case) I guess it's dependant on the acceptation of that other FR as it is related.
Author
Owner

@jeremystretch commented on GitHub (Sep 13, 2023):

I'm going to close this out as I've declined to implement #13079, and there has been no further justification offered for its implementation. As we're moving to adopt a new UI theme anyway, it's best to avoid any style changes in the interim where possible.

@jeremystretch commented on GitHub (Sep 13, 2023): I'm going to close this out as I've declined to implement #13079, and there has been no further justification offered for its implementation. As we're moving to adopt a new UI theme anyway, it's best to avoid any style changes in the interim where possible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8270