Extension talk:LoopFunctions

can you please provide a foreach function that will take a text, separator, param pattern, output separator, replacement and, will split the text with the first separator, iterate over the resulting array, replacing the param in pattern (so if an item is foo1_bar, and the param pattern is foo$n$_bar, then $n$ is 1), creating another array that is then joined with the output separator?

LoopFunctions + VariablesExtension
So I'm trying to combine these two extensions with frustrating results. If I have the following:

*

I get these results:


 * 0
 * 1
 * 1
 * 1
 * 1
 * 1
 * 1
 * 1

It looks like the #vardefine and #var functions inside the loop are getting resolved before the loop even starts. For the life of me, I can't figure out if it's a problem with the LoopFunctions, the VariablesExtension, or both. &mdash;Sledged 22:37, 19 January 2007 (UTC)

I tried to help you out...I guess you can't nest for loops.

{{#for:7 | {{#expr:+1}} {{#for:1 | {{#vardefine:odd|{{#expr:+1}} }} }}

Mcpaige 04:47, 28 February 2007 (UTC)

LoopFunctions + Template
This might not be the best way to do this, but here goes.

On page Table I put  , the template TheInfoList looks like this   . There are a bunch of templates named TheInfo1, TheInfo2, TheInfo3, TheInfo... which actually in turn look like this   and of course TheInfo handles all the html and formating and stuff. The loop does not handle templates, what I get on page Table is
 * Template:TheInfo1
 * Template:TheInfo2
 * Template:TheInfo3
 * Template:TheInfo4

with links, the templates are not being included. Any ideas ? Mcpaige 04:26, 28 February 2007 (UTC)


 * This is along the lines of the mentioned limitation. I expanded that section.--Patrick 12:09, 28 February 2007 (UTC)

Hooks (aka "Custom HTML Tags")
They don't seem to work inside a looping function.

I have Extension:Colorize installed and when I do this:

NS:Somepage

Template:foo

I get this: 1 2

As you can see, the "rep$n$" ouside of the "colorize" hook gets replaces as expected, but not the one inside.

Edit: It doesn't matter if I "include" Extension:Colorize before or after Extension:LoopFunctions in LocalSettings.php

Egingell 03:42, 27 April 2007 (UTC)