Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Arvind Nedumaran
ns to Django itself) Subject: Re: Overriding template blocks without copy/pasting entire template files If you look at the mails beyond the first one, you will see that Josh & Carlton already came to that conlusion ;) On Tuesday, June 16, 2020 at 2:16:31 PM UTC+2, Arvind Nedumaran wrote: Cou

Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Florian Apolloner
2020 6:46:45 PM > *To:* Django developers (Contributions to Django itself) < > django-d...@googlegroups.com > > *Subject:* Re: Overriding template blocks without copy/pasting entire > template files > > If you look at the mails beyond the first one, you will see that

Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Arvind Nedumaran
une 16, 2020 6:46:45 PM To: Django developers (Contributions to Django itself) Subject: Re: Overriding template blocks without copy/pasting entire template files If you look at the mails beyond the first one, you will see that Josh & Carlton already came to that conlusion ;) On Tuesday, Jun

Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Florian Apolloner
If you look at the mails beyond the first one, you will see that Josh & Carlton already came to that conlusion ;) On Tuesday, June 16, 2020 at 2:16:31 PM UTC+2, Arvind Nedumaran wrote: > > Could you elaborate on how this is different from extending a base > template and re-defining the

Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Arvind Nedumaran
Could you elaborate on how this is different from extending a base template and re-defining the necessary blocks? #base.html {% block title %}{{ section.title }}{% endblock %} . {% extends "base.html" %}{% block title %} My custom title that isn't section.title {% endblock %} This much

Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Carlton Gibson
Yes! Absolutely. There's even a ticket for that: https://code.djangoproject.com/ticket/29336 There was a PR, but we couldn't get it down to size... (Review ) On Tuesday, 16 June 2020 08:29:27 UTC+2, Josh Smeaton wrote: > > Upon

Re: Overriding template blocks without copy/pasting entire template files

2020-06-16 Thread Josh Smeaton
Upon reflection, would you agree that this should be documented a little better? The release notes at the time had a vague deprecation note about ` supports_recursion` being removed, and the main docs https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#std:templatetag-extends have no

Re: Overriding template blocks without copy/pasting entire template files

2020-06-15 Thread Josh Smeaton
Changed 5 years ago by Preston Timmons 臘‍♀️ Thanks Carlton - I guess it has *only* been 5 years though :) On Tuesday, 16 June 2020 15:41:29 UTC+10, Carlton Gibson wrote: > > Hi Josh. > > This was added in

Re: Overriding template blocks without copy/pasting entire template files

2020-06-15 Thread Carlton Gibson
Hi Josh. This was added in Django 1.9 here https://github.com/django/django/commit/fc2147152637e21bc73f991b50fa06254af02739 It leverages the extends tag, re-using the same template name: # myapp/templates/admin/base.html {% extends "admin/base.html" %} {% block footer %}this site