Closed ebertti closed 2 days ago
Adding help sections or specific documentation for each model.
Including visualizations of charts or data related to the object being edited.
You could use the form_before
and form_after
blocks to customize the change form template.
Inserting buttons or links for custom actions that interact with the object being edited.
You could use the actions_detail
field on the ModelAdmin definition for this.
Hi @YashitM
Yes, it is indeed possible to use Django's template overriding features to achieve some of these customizations. However, this approach often hides the modifications in the template files, making maintenance more challenging in the long run.
Additionally, using template includes allows for reuse of the same include in multiple pages, which simplifies maintenance and keeps the customizations more organized and explicit. This way, it is immediately clear from the admin class itself that there are custom includes for that specific admin, reducing potential issues during future updates of both Django Admin and Django Unfold.
Thank you again for your input, and I hope this clarifies my suggestion.
@ebertti what do you think? #726
Hello,
First, I want to thank you for the amazing work you’ve done with this project. The theme has greatly improved the customization and usability of the Django Admin.
I would like to suggest a new feature that I believe could bring even more flexibility and power to the Django Admin. It would be incredibly useful to have the ability to include custom HTML templates directly into the change-forms of the Django Admin. This would allow developers to add dynamic content or custom interfaces directly on the edit page of an object without needing to resort to hacks or complex solutions.
Some use cases for this feature include:
I believe this feature could be implemented in a flexible way, perhaps allowing developers to include additional template blocks through hooks or specific settings in the admin.
Screenshots
Examples on others admin templates?
https://django-suit.readthedocs.io/en/develop/form_includes.html#example https://github.com/otto-torino/django-baton?tab=readme-ov-file#form-includes
Thank you for considering this suggestion. I am available to discuss further details.