Template talk:For loop

Suppress separator (1=) when returned value is empty
The separator (1) should be suppressed if the returned value for a parameter is empty. It's already doing this when the input is empty (regardless whether y is set). Example: produces: The comma-space is being passed as the separator to this template by that one. It is being generated for the invalid "Foo" entry which returns nothing from the template that is called. The empty parameters (which, if numbered, would 3 and 4) do not have this problem. — SMcCandlish ☏ ¢ 😼  12:01, 23 December 2018 (UTC)
 * Pppery fixed it.  — SMcCandlish ☏ ¢ 😼  05:02, 22 February 2019 (UTC)

How to automate transclusion of numbered templates?
I'm trying to remove the duplication on the page Portal:Doctor Who/Selected quotes, which transcludes ten subpages Portal:Doctor Who/Selected quotes/1 .. Portal:Doctor Who/Selected quotes/10. The specialty of For loop is passing a changing parameter into a single particular template.

I've tried tricking For loop into transclusion of several different templates using 1x and brackets (( and )) as follows:

but this only outputs the wikitext of transclusions Portal:Doctor Who/Selected quotes/1 .. Portal:Doctor Who/Selected quotes/10:

is there any way to use for loop to achieve this? I've also tried using Template:Eval, but it is only for substing. —⁠andrybak (talk) 21:09, 24 May 2020 (UTC)
 * Instead of 1x, use expand wikitext:


 * — swpb T&#8201;•&#8201;go beyond&#8201;•&#8201;bad idea 15:08, 27 May 2020 (UTC)
 * FYI this can be done without for loop. For example, by using template Numbered subpages. See more at . —⁠andrybak (talk) 17:18, 7 June 2020 (UTC)

Discussion at Wikipedia:Village pump (technical) § For loops for a category
You are invited to join the discussion at Wikipedia:Village pump (technical) § For loops for a category. &#123;{u&#124; Sdkb  }&#125;  talk 23:29, 3 December 2020 (UTC)

use the PV value twice in the for loop
I am looking to use the process variable twice in the for loop. This example loop uses it once.

It creates this string 0|0|0|0|pv|pv But I want to create the string 0|0|0|0|5|6 Jrkenti (talk) 00:56, 15 April 2022 (UTC)


 * This template isn't set up to do that by itself. One way to do this would be to create another template that performs the math, and call that template with a for loop:, e.g.:


 * New template "if_gt_4":


 * For loop call:


 * I've set this up using my sandbox:


 * — swpb T&#8201;•&#8201;go beyond&#8201;•&#8201;bad idea 15:15, 18 April 2022 (UTC)