Module talk:Template wrapper

using positional parameters
This module was initially written so that positional parameters in the wrapper template are not passed on to the working template. That's fine for templates like the cs1|2 templates because they do not use positional parameters but is problematic for templates like which wraps.

So I've invented a new parameter for Module:template wrapper: _pass-all which when set to  in the module   causes the module to pass all wrapper-template parameters except those listed in _exclude to the working template. Here is which uses Module:template wrapper/sandbox with yes to wrap  which invokes Module:Catalog_lookup_link/sandbox:

Here is which uses Module:template wrapper/sandbox without _pass-all to wrap  which invokes Module:Citation/CS1. Positional parameters are used by and not passed to :

Compare the live :

What have I missed?

—Trappist the monk (talk) 11:29, 19 August 2018 (UTC)
 * Unless I'm misunderstanding something, the below looks like it will add all the positional pframe_args regardless of _exclude or unset.  I think the below would do what you intend.   It might make more sense to use _pass_positional instead of _pass-all since _exclude still applies. frame_args_get should also be adjusted so that the new parameter isn't passed. —&thinsp;JJMC89&thinsp; (T·C) 18:11, 19 August 2018 (UTC)
 * I did not intend that positional parameters should be excludable. Perhaps they could be but how is that properly handled?  If we pass   and exclude   what do we do with   et seq.?  Does   become the new  ?  I just didn't want to venture along that cow track until there is a demonstrated need to go there.
 * I didn't consider the possibility of a positional parameter having the  value.  I'll fix that.
 * Using  as I did ensures that empty positional parameters are passed along to the working template.  In the   version, the   prevents empty positional parameters from being added to the   table.
 * I overlooked adding _pass-all to ; I'll do that.  As you can see I was not very successful in finding a good parameter name.  _pass-all is the shortest I could come up with and was, I felt, marginally better than _pass-positional which I felt implied 'only' but was shorter than _include-positional which was the best in terms of describing what it does at the expense of length;  I was hoping for a single word but was unable to find one that is suitable.  I'll change to _include-positional.
 * —Trappist the monk (talk) 21:29, 19 August 2018 (UTC)
 * I misunderstood your comment in the module then. Let's not let positional parameters be excluded with _include-positional; I agree it would be difficult to properly handle. I made this edit. I think the sandbox looks good now. —&thinsp;JJMC89&thinsp; (T·C) 21:53, 19 August 2018 (UTC)
 * Yeah, we edit conflicted over that. I've updated the live module.
 * —Trappist the monk (talk) 22:36, 19 August 2018 (UTC)
 * Potentially a dumb question, but is there a way to pass all but one positional parameter? I tried a bunch of ways to exclude positional parameter "1" in Template:Multiref2/sandbox before reading this discussion. If there's not a clean solution, I'll leave it as is. Rjjiii (talk) 02:39, 12 July 2023 (UTC)
 * I don't think so. But why would you want to?  Positional parameters have meaning so suppressing   in the call to the working template 'bumps' the subsequent positional parameters: wrapper template   becomes working template   and so on.  For  that doesn't much matter but for other templates it can make a hash of things.
 * I think that you will need to make a very strong case for a modification to this module.
 * —Trappist the monk (talk) 13:07, 12 July 2023 (UTC)
 * Gotcha, I'm not asking for a modification, just making sure that I understand how the module works. Rjjiii (talk) 19:20, 12 July 2023 (UTC)
 * An additional follow-up: On second thought, it made more sense to style the first positional reference rather than filter it out. Disregard my confusion above. Rjjiii (talk) 06:48, 16 July 2023 (UTC)
 * I think that you will need to make a very strong case for a modification to this module.
 * —Trappist the monk (talk) 13:07, 12 July 2023 (UTC)
 * Gotcha, I'm not asking for a modification, just making sure that I understand how the module works. Rjjiii (talk) 19:20, 12 July 2023 (UTC)
 * An additional follow-up: On second thought, it made more sense to style the first positional reference rather than filter it out. Disregard my confusion above. Rjjiii (talk) 06:48, 16 July 2023 (UTC)

support for aliasing and parameter name reuse;
I have added code so that the wrapper templates can support parameter aliasing and same-name reuse. Also updated the documentation. Existing applications should not notice the change. But, famous last words, those, report anomalies here.

—Trappist the monk (talk) 13:46, 17 November 2018 (UTC)

_substall
@Pppery: If you are going to make changes to this module, please document those changes both in the code and in the doc page.

Please explain this: How is the one different from the other?

—Trappist the monk (talk) 19:09, 19 February 2019 (UTC)
 * One of those actually transcludes the template, whereas the other one returns a wikitext version of the template. The purpose of that edit was, as I explained in the edit summary, to make this module easier to use for substituted templates. To demonstrate this, support you have a template X1, which contains the code . If no is specified, then substing Template:X1 will produce a transclusion of Template:X2, as opposed to a substitution of Template:X2 which is produced without the _substall param. &#123;&#123;3x&#124;p&#125;&#125;ery (talk) 19:14, 19 February 2019 (UTC)
 * @Pppery: If you are going to make changes to this module, please document those changes both in the code and in the doc page.
 * —Trappist the monk (talk) 15:59, 22 February 2019 (UTC)
 * A substitute option would indeed be really useful. I see your edit summary when you reverted. Are these problems surmountable? &mdash; Martin (MSGJ · talk) 12:32, 8 February 2024 (UTC)