Talk:Implicit passing of parameters to recursive template calls

While processing Template:T1, I want to call Template:T2. I want to pass some args specifically to T2, but for the code to otherwise be evaluated in the same environment as it would if I directly evaluated T1.

If I just evaluate 'v' as, it substitutes away during transclusion (but including the template using 'safesubst' works).

Is it possible to escape  such that it survives transclusion and is then evaluated in the context of T1?

&rArr; Nom (Contribs • Message • Email ) 01:36, March 10, 2021 (EST)
 * I don't understand what you are asking exactly, but by having a look at your tests I believe you are trying to pass parameters to a subtemplate without the top template recognising them. This cannot be done in this way as each template's parameters are private to that template. Global variables however can be created using  or  . Those variables are global for the whole page (from the point they are defined to the end) and any transcluded templates can access them. The variables can also be created inside the templates and then accessed in the page. An exception to that is DPL calls. Variables declared or accessed in the phantom template may or may not exist in the page. I think dplvars do not have the same issues.  The question now is why do you want to do that? &rArr; Faltout (Contribs • Message • Email ) 09:16, March 10, 2021 (EST)