Thread:Extension talk:Loops/where do you use that/reply (3)

Chess diagrams are certainly not the best examples for using loops. Loops are creating a much more complex syntax to edit, in addition to being seriously dangerous for the server. In chess diagrams, where the number of cells is dully predictable, so that the number of loops o perform remains static and in fact still small, generatng loopless static code is much simpler. The Chess diagram template code shows it clearly, even if it uses a subtemplate for generating each row, and another subtemplate for generating each cell.

If you want a more convincing example, imagine a case where you'll need a variable number of loops to enumerate and process each page entry found in a category (provided that it is not overpopulated with more than 100 entries, this limit being extensible to 200 with a global setting to match the number of entries displayed on a single page of category).


 * Such application would use the loop
 * and of a call to
 * and ) and Extension:Variables (for   and  ).
 * and ) and Extension:Variables (for   and  ).

With such processing loops, it will be possible to generate custom reports and analysis on the content of a category: for example when such a category is used to reference all subpages containing a template-like switch returning some information fields (in their includeonly section) and showing a complete detailed information page about an item (in their noinclude section, using a presentation template detailing the information fields detailed).

Similar processing loops could also be used with WikiData to enumerate and report the content rows of a Wikidata table matching some query criteria, or to enumerate a items found in a variable properties list (associated to a global object, or to a data row returned by an SQL query extension if they may contain collections such as a list of POIs in a geographic query, or to the variable metadata types associated with pages, including media files).