Opened 4 years ago

Last modified 4 years ago

#32109 closed Bug

Cannot add content to admin sidebar without breaking layout — at Initial Version

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

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, the sidebar block should be defined inside <div id="content-related">, so that template authors can add content to the sidebar.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top