Skip to content

Pass context to template tag override #193

Open
@tbrlpld

Description

@tbrlpld

Is your proposal related to a problem?

When overriding a template tag you have the option to render another template in its place.

Currently, only the existing template context (from the yaml file) of that template will be taken into account.
It would be nice to have the option to pass context overrides to the template.

Describe the solution you'd like

E.g. in a template override like this:

tags:
  include_block:
    tl with size="2xl" heading_level=sub_heading_level:
      template_name: "atoms/teaser-link/teaser-link.html"

I would love to be able to do something like this:

tags:
  include_block:
    tl with size="2xl" heading_level=sub_heading_level:
      template_name: "atoms/teaser-link/teaser-link.html"
      context_override: 
        size: "2xl"
        heading: "Overrding the heading form the template context yaml"

Describe alternatives you've considered

An alternative is to create specific variants of the template I really want to use. That has the tendency to clutter the template directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    djangoRelated to Django templates capabilitiesenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions