Help Needed: Embedding Custom HTML Content in Device Detail Page via Plugin #14552
Unanswered
MokhlesINAP
asked this question in
Help Wanted!
Replies: 1 comment
-
The ways to extend core views in plugins are documented here: https://docs.netbox.dev/en/stable/plugins/development/views/#extending-core-views You can add tabs to a core view, and you can inject content into certain parts of the page (left, right, bottom, and buttons). As far as I can see, there is no mechanism provided to override the entire page, and surely that couldn't work anyway. For example, what if two plugins both wanted to replace the device detail page? I suggest you stick to the documented approaches to extending the device details. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello NetBox Community,
I am developing a plugin for NetBox and have encountered a challenge that I hope you might be able to help me with. I've been trying to embed custom content (initially an iframe, now simplified to an h1 tag) directly into the device detail page, but despite following the documentation and various suggestions, my changes do not appear on the page.
Here’s a summary of what I have done:
Plugin Setup: My plugin, named netbox_iframe_manage, is structured with the standard init.py, templates, and templatetags directories. The plugin is recognized by NetBox and loaded without issues.
Custom Template: I created a custom template at netbox_iframe_manage/templates/netbox_iframe_manage/dcim/devices/device.html, intending to override the default device detail template. This template extends dcim/devices/device.html and includes a simple h1 tag for testing purposes.
Template Tag: In templatetags/iframe_tags.py, I defined a simple inclusion tag, but this part is now less relevant as I'm directly trying to modify the device detail template.
Plugin Configuration: In my init.py, I set templates_dir = 'netbox_iframe_manage/templates/netbox_iframe_manage'.
Despite these configurations, the custom content does not show up on the device detail page. Here are some specific questions I have:
Are there any known issues or special considerations when overriding existing templates in NetBox plugins?
Is there a recommended approach or best practice for achieving this kind of customization in NetBox?
Any insights, suggestions, or pointers to relevant parts of the documentation would be greatly appreciated. Thank you in advance for your time and help!
Beta Was this translation helpful? Give feedback.
All reactions