Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-03-10 Thread Daniel Dekany
Over .get_optional_template(name[, options]), (https://freemarker.apache.org/builds/fm2.3.28/ref_specvar.html#ref_specvar_get_optional_template) I have also added: - .caller_template_name (https://issues.apache.org/jira/browse/FREEMARKER-83)

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-28 Thread Daniel Dekany
.get_optional_template(name[, options]) now implemented in the 2.3-gae and 2.3 branches. Testing/feedback is welcome! See commit: https://github.com/apache/incubator-freemarker/commit/51c2476621809d8f4183f23e894be0106cabe810 You can find some examples in the tests:

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-18 Thread Taher Alkhateeb
I feel clumsy now :) Thank you for the explanation, I'm beginning to understand this a bit. I'll follow up on the JIRA On Sat, Feb 17, 2018 at 7:57 PM, Daniel Dekany wrote: > Saturday, February 17, 2018, 2:36:37 PM, Taher Alkhateeb wrote: > >> Ahh I see, I guess that's the

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-17 Thread Daniel Dekany
Saturday, February 17, 2018, 11:56:43 AM, Jacques Le Roux wrote: > Hi, > > I must say it's much easier for me to understand Jacopo's solution. That's not really a solution though, rather a work around that works in some cases, but not in others. Jacopo basically says, as far as I see, that we

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-17 Thread Taher Alkhateeb
Wrong link, sorry, correcting. http://jinja.pocoo.org/docs/2.10/templates/#include On Feb 17, 2018 11:34 AM, "Taher Alkhateeb" wrote: > For a point of comparison, the python jinja2 template engine (widely used) > has an "include" directive that has an attribute

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-17 Thread Taher Alkhateeb
For a point of comparison, the python jinja2 template engine (widely used) has an "include" directive that has an attribute named "ignore missing" [1]. I also remember seeing similar behavior in other engines. So I guess perhaps from a usability point of view this seems to be a desired feature by

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-17 Thread Jacopo Cappellato
On Fri, Feb 16, 2018 at 8:04 AM, Daniel Dekany wrote: > Some more opinions guys? Especially as we got one opinion against the > feature. > Just to clarify my opinion: I am not against this feature; I simply don't consider it a must since there are some workaround to get a

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-15 Thread Daniel Dekany
Some more opinions guys? Especially as we got one opinion against the feature. Tuesday, February 13, 2018, 9:59:41 AM, Daniel Dekany wrote: > Tuesday, February 13, 2018, 9:28:18 AM, Jacopo Cappellato wrote: > >> For less common use cases like this my preference is to defer the >> implementation

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-13 Thread Daniel Dekany
Tuesday, February 13, 2018, 9:28:18 AM, Jacopo Cappellato wrote: > For less common use cases like this my preference is to defer the > implementation to the template developer rather than adding complexity to > the language. > If I understand the use case that originated this request, something >

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-13 Thread Jacopo Cappellato
For less common use cases like this my preference is to defer the implementation to the template developer rather than adding complexity to the language. If I understand the use case that originated this request, something similar could be achieved with a simple trick like the following: 1) the

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-12 Thread Daniel Dekany
Monday, February 12, 2018, 12:52:26 AM, jpr...@seznam.cz wrote: > Opinion: > > It seems reasonable. As you suggested, it also seems a little advanced in > style for most cases. > It's very flexible, a bit verbose for common use, a bit of a learning curve > for template author. > > I would prefer

Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates

2018-02-11 Thread jprice
Opinion: It seems reasonable. As you suggested, it also seems a little advanced in style for most cases. It's very flexible, a bit verbose for common use, a bit of a learning curve for template author. I would prefer a shorter name, like ".get_template". Isn't it up to the template author to