Skip to content

Add more blocks to base.html to make it easier to extend #6339

@ababic

Description

@ababic

I currently have a need to output an additional form at the top of the page in the Browsable API view. I'm happy creating a Renderer class with custom template to achieve this. But currently, if I want to preserve the existing functionality in the template, my only option is to copy the entire contents of the content block from base.html - which is less than ideal.

Breaking the content block up into a few smaller blocks would make it easier to override just the relevant part of the template, while introducing very few downsides. For example, adding a form to the top of the page could become as simple as doing this in a custom template:

{% block request_forms %}
    {{ block.super }}
    <div class="my-custom-form"></div>
{% endblock %}

Metadata

Metadata

Assignees

No one assigned

    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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy