Re: include_block template tag

2021-07-12 Thread Pierre Vanliefland
Hi Kye! I've been using this code for a few months now, without encountering any serious problem so far: https://gist.github.com/pvanliefland/bb676a906b900c7e29e46b474038a6ca I would say that the main issue with this approach is readability. Once you reach 3 or 4 levels of embeds, between

Re: include_block template tag

2021-07-11 Thread m...@kye.id.au
Hi Pierre, I have been silently watching your progress with great enthusiasm. This limitation of the DTL has been a thorn in my side for years. Are you able to share any updates about your progress? Cheers Kye On Friday, April 23, 2021 at 3:00:50 PM UTC+8 Pierre Vanliefland wrote: > Hi

Re: include_block template tag

2021-04-23 Thread Pierre Vanliefland
Hi Carlton, That would make sense. I'll keep testing/playing with it for the next few days, and will package it afterward. Kind regards, Pierre On Friday, April 23, 2021 at 6:19:34 AM UTC+2 carlton...@gmail.com wrote: > Hi Pierre. > > If you were to bundle it in a package and put in on

Re: include_block template tag

2021-04-22 Thread Carlton Gibson
Hi Pierre. If you were to bundle it in a package and put in on PyPI, that would allow others to easily experiment and feedback too. Kind regards, Carlton On Thu, 22 Apr 2021 at 21:33, Pierre Vanliefland < pierre.vanliefl...@gmail.com> wrote: > Thanks Jure! In the meantime, I have started

Re: include_block template tag

2021-04-22 Thread Pierre Vanliefland
Thanks Jure! In the meantime, I have started testing my code extensively and spotted a few problems, mostly linked to the usage of block nodes within {% embed %}. I have decide to use a new tag, {% slot %}, with a much simpler implementation and it seems to work just fine. I have updated the

Re: include_block template tag

2021-04-19 Thread Jure Erznožnik
Hi Pierre, I like your solution very much: implements what needs to be implemented, rationalises it very well and also adds all the other bits'n'pieces required for a proper PR. I really hope this gets accepted, it was a huge thorn in our butts until we implemented it. Now we're (ab)using

Re: include_block template tag

2021-04-17 Thread Pierre Vanliefland
Hi Carlton, Thanks for replying so quickly. It's definitely been an itch for me, as check the docs and Stack Overflow every year to check if this has been implemented! I've completed the Gist with an "include/extends" example, but I haven't done the same for inclusion tags: as far as I know,

Re: include_block template tag

2021-04-16 Thread Carlton Gibson
Hi Pierre, No problem at all! There’s some itch that folks have here so all for the good discussing it. Thanks for your work on the gist it looks good. I just glanced at it now, and need to sit down longer but, can I ask you to add a “What’s wrong with the current tools” section to text?

Re: include_block template tag

2021-04-16 Thread Pierre Vanliefland
Hello! First, sorry if it is not appropriate to bring back this thread from the grave, but I spent some time on finding a solution for this and came up with an implementation that: 1. Needs very little code 2. Re-uses the existing code for the extends and include tags I have written a

Re: include_block template tag

2020-12-02 Thread Jure Erznožnik
Final comment for this: we implemented the tag in our dynamicforms library (commit with initial implementation ). The initial implementation straight-out replaces the django include tag, giving it an

Re: include_block template tag

2020-08-19 Thread Carlton Gibson
Hey Sam. (“I” is a placeholder in what follows…) What I’m missing here, personally, having read this thread, and the old-one is motivating examples where I go "wow, yeah, that would really make my life easier”. I read it and think yeah maybe. I see a couple of positive comments from people

Re: include_block template tag

2020-08-19 Thread Sam Willis
Hi Carlton, Thanks for chipping in. As a long time user of Django (I first stated with it back in 2006) from my experience where is excels is in providing a full toolbox for building things for the web. The most successful “third party” apps and library’s tend to be very large editions of

Re: include_block template tag

2020-08-19 Thread Jure Erznožnik
It definitely does. Thanks. Jure On 19/08/2020 14:03, Carlton Gibson wrote: From the thread, I’d suggest collaboration with Curtis if the ideas are similar enough. Also from the thread: the idea seems to fit between include as we have it now, and a custom tag. Maybe that gap hasn’t been

Re: include_block template tag

2020-08-19 Thread Carlton Gibson
>From the thread, I’d suggest collaboration with Curtis if the ideas are >similar enough. Also from the thread: the idea seems to fit between include as we have it now, and a custom tag. Maybe that gap hasn’t been wide enough to grasp sufficient interest? I think the standard path for

Re: include_block template tag

2020-08-19 Thread Jure Erznožnik
Hi Sam, It seems that even your complete proposal with working code did not receive any attention from the core developers at the time. It would seem from that thread that Jonathan Slenders also made a similar proposal / solution and it too was rejected. Well, his was at least rejected -

Re: include_block template tag

2020-08-18 Thread Sam Willis
Hi Jure, I think this would be a great addition to Django! I also proposed something a few years ago which was almost identical (https://groups.google.com/d/msg/django-developers/-75sOjhJuRU/ax_TZJgRmPQJ) and had a basic implementation (it probably won't work anymore without some tweaks).

Re: include_block template tag

2020-08-17 Thread Curtis Maloney
Interesting ideas... and looks similar to some of the features I put into Sniplates: https://sniplates.readthedocs.io/en/latest/ If you like we can work on adding this to sniplates, if it's not accepted into core. -- Curtis On Mon, 17 Aug 2020, at 19:05, Jure Erznožnik wrote: > While

include_block template tag

2020-08-17 Thread Jure Erznožnik
While rendering templates we often come into situations where data remains the same, but sometimes we want to render it one way, other times - another. Examples: a library supporting various CSS frameworks. You would always render panel