extra blocks for templates allowing customization#952
Open
birddevelper wants to merge 7 commits intosmithyhq:mainfrom
Open
extra blocks for templates allowing customization#952birddevelper wants to merge 7 commits intosmithyhq:mainfrom
birddevelper wants to merge 7 commits intosmithyhq:mainfrom
Conversation
aminalaee
reviewed
Oct 2, 2025
Collaborator
aminalaee
left a comment
There was a problem hiding this comment.
I think this is great, can we just follow Flask-Admin to be aligned with other features?
https://flask-admin.readthedocs.io/en/v1.0.9/templates/#jinja2-flask-admin
1 task
Member
|
@birddevelper update? |
Contributor
Author
|
@mmzeynalli Will be updated soon. ;) |
2224788 to
09f0e84
Compare
Member
|
LGTM. But, I think it would be better to write tests for these, to make sure it is indeed in correct part of the HTML. |
mmzeynalli
referenced
this pull request
in mmzeynalli/sqladmin-ng
Mar 30, 2026
Added extra blocks for templates allowing customization
Member
|
@birddevelper any updates with tests? |
Contributor
Author
|
Sorry, I couldn't add the tests yet. Can you please help adding tests?
|
mmzeynalli
approved these changes
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, adding a component to any part of the templates requires copying all the inherited template markup into the child template.
This PR refactors the
contentblock into smaller, modular blocks, similar to how Django admin templates are structured. This allows developers to seamlessly insert components into a page without duplicating the entire template.For example, to add a new button next to the existing top buttons:
{% extends "sqladmin/list.html" %} {% block object_tools_items %} {{ super() }} <div class="ms-3 d-inline-block"> <a href="some-link.html" class="btn btn-success"> Some new button </a> </div> {% endblock %}Result:

This PR also splits the
headblock into two separate blocks,extraheadandextrastyle, similar to Django admin templates.