-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: explain how to customize details view (add extra stuff at the top and/or bottom, via template fragment) #294
Comments
Not sure if I got this right, but I guess I need to extend the existing one and, inside mine, redefine the body, call the one from which I am extending and then add my own extra stuff? I mean:
Is that it? |
Unfortunately I can't define my own detail-form-entity.html because of #295 What I wanted to be able to do:
Unfortunately I cannot pass |
You can override the content block to add a footer {% extends "detail.html" %}
{% block content %}
{{ super() }}
{# footer #}
{% endblock %} |
Overriding |
What are the interesting objects I can use from the template? I am looking at detail.html and I see:
Where can I find details/tips? Searching the docs... Thanks! |
I believe docs doesn't tell much about these, we've talked about the documentation with @jowilf. The documentation requires more explanation for a better user experience. I'd like to help about it, we can get inspired by the issues and discussion to explain what. Or maybe add other examples. I have added an example to cover fields in #379 and planning to extend it. We can have more examples but even do, there are times that I can not remember some stuff from examples folder. We should improve the documentation. |
As a workaround for my attempt at #282 , I was thinking of customizing the details.html view of my entity. I was thinking of "showing extra stuff at the bottom".
I see https://github.com/jowilf/starlette-admin/blob/main/starlette_admin/templates/detail.html but copying/pasting the entire file just to customize a "footer" seems wrong.
If it is possible to "extend" an existing view with extra stuff at the top and/or bottom, please let me know where it says so in the documentation. Or maybe the documentation needs to be created?
If, on the other hand, there is no such feature, then I would humbly suggest that some well-know templating hooks be added, such as "pre-entity" and "post-entity", so that just this localized override can be written. Im my case, I could show the map for the entity being shown, for example (lat/long), as mentioned in issue ttps://github.com//issues/282 . Another use case I have is that the entity represents a chatbot config, and at the bottom I could have an interactive preview of the hatbox as defined. And so on.
Thanks for listening.
The text was updated successfully, but these errors were encountered: