Opened 4 years ago
Last modified 4 years ago
#32109 closed Bug
Cannot add content to admin sidebar without breaking layout — at Version 1
Reported by: | Ben Davis | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 3.1 |
Severity: | Normal | Keywords: | admin sidebar template |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
If I want to add content to the sidebar on the admin index page, I would normally override admin/index.html like so:
{% extends "admin/index.html" %} {% block sidebar %} <p>Other stuff</p> {{ block.super }} {% endblock %}
However, using {{block.super}}
breaks layout because it contains <div id="content-related">
, which is floated right to achieve the sidebar look. Adding any content before this will shift the sidebar to the bottom of the page.
Ideally, there should be another block inside <div id="content-related">
, possibly called {% block sidebar_content %}
, so that template authors can add content to the sidebar.