torchbox / torchbox/django-pattern-library

Add the ability to override tags in extended and included templates

Open
#138 1 comment 0 reactions 1 assignee View on GitHub

@bcdickinson is already working on this.

Since Jan 6, 2021.

django enhancement
Dominant language
Python
Stars
423
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Is your proposal related to a problem?

Currently, if you have templates like this with an overridden template tag foo...

base.html:

<p>{% foo %}</p>

extended.html:

{% extends "base.html" %}

included.html:

{% include "base.html" %}

... it's not possible to control the output of foo from extended.yaml or included.yaml, only the values set in base.yaml will have any effect.

Describe the solution you'd like

It would be great if the ability to override tags cascaded/inherited the same way as template context.

Describe alternatives you've considered

It's not possible to work around this without duplicating the tag invocation in the inherited template, as far as I know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.