Skip to content

Inconsistent template override behavior in custom/templates #1369

@timullrich

Description

@timullrich

Missing {{ block.super }} in bottomimports blocks breaks custom overrides

Describe the issue

Several core templates override the bottomimports block without including {{ block.super }}.
This prevents customizations defined in base.html (via custom/templates/base.html) from being loaded consistently.

Examples:

  • about.html → works, since it doesn't override bottomimports.
  • latest-media.html (and others) → overrides bottomimports but does not call {{ block.super }}, so any global scripts/styles added in base.html are lost.

Expected behavior

All templates overriding bottomimports should include {{ block.super }} at the beginning of the block, e.g.:

{% block bottomimports %}
  {{ block.super }}
  <script src="{% static "js/latest.js" %}?v={{ VERSION }}"></script>
{% endblock bottomimports %}

This ensures global imports (e.g. custom scripts or styles injected via base.html) are preserved.

Steps to reproduce

  1. Add custom/templates/base.html with a <script src=".../custom-sidebar.js">.
  2. Visit /about → script is loaded.
  3. Visit /latest → script is missing, because bottomimports was replaced.

Why this matters

Users rely on the documented override system (custom/templates/) to customize MediaCMS without patching the core.
If some templates drop {{ block.super }}, customizations become unreliable and inconsistent across pages.

Suggested fix

Audit all templates overriding bottomimports and prepend {{ block.super }}.
This makes the override system work consistently across the entire app.

Affected files

❌ /home/mediacms.io/mediacms/templates/base.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/add-media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/categories.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/embed.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/featured-media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/history.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/index.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/latest-media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/liked_media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/manage_comments.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/manage_media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/manage_users.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/members.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/playlist.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/recommended-media.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/search.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/tags.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/user.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/user_about.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/user_playlists.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/user_shared_by_me.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/cms/user_shared_with_me.html (missing block.super)
❌ /home/mediacms.io/mediacms/templates/root.html (missing block.super)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions