Forum:Need help with for-type situation

The template I am working on, , needs to have a tab for each volume and each disc in the currently selected volume. There will be two rows of tabs. One lists the volumes. The other lists the discs for the current volume.

I am having problems with this. Since there are no true for loops in Wikitext, I thought I could use recursion. I saw something stating that there are limits to how deep I could recurse (not unexpected as most languages have a stack limit), but I thought I would never reach that due to the number of volumes and discs in a typical box set.

In reality, I am having problems. The first call to my template works fine. It's the second call that I have problems with. I tried creating an intermediate template in, but that did not help. Either way, the second call acts like I passed no parameters at all. Yet the parameters are being passed.

The templates that recurse as of now are w:c:ChristianMusic:Template:Box Set Volume Cell and w:c:ChristianMusic:Template:Box Set Disc Cell. One handles volumes. The other does discs.

Is there another way around this problem? Could there be a way to do a for loop that I missed? I never understood how the for template would help me. Will (talk -- contribs) 00:43, 10 October 2006 (UTC)


 * There was a pipe inside the template call that was inside the #ifexpr: that decided whether to recurse or not. Hiding it with a template call did not help. Will (talk -- contribs) 03:58, 10 October 2006 (UTC)

I have found a rather poor workaround. I made the volume calls non-recursive for testing. This made the subtemplate for the volumes more complex as I had to hide some pipes from the #ifexpr: that I had to move up. I also had to require the main template to call the volume subtemplate 7 times to support 7 volumes. Before I could handle any number of volumes as long as the server was able to execute the instructions.

I am not happen with the new solution. As such, I have yet to implement it for the disc row. If you have a better way, please say so. Will (talk -- contribs) 04:24, 10 October 2006 (UTC)


 * There are no loops in Parser Functions (The version here dosen't even do rand). If you want a loop you'll half to have a modified version of Winter installed on you wiki. The reason I say modified is because Winter has some functions with the same name as functions in Parser Functions. I suggest having a c placed infront of those functions. Like making Winter's if cif. Dantman (Talk) 22:55, 13 October 2006 (UTC)

Is there any support for recursing? That would work. I have code that would stop the recursion once enough cells have been added. Will (talk -- contribs) 00:35, 14 October 2006 (UTC)


 * There are some interesting recursions you can do, for specific iterations, such as this user template on WP. Note that this template will not work on Wikia currently, as it requires html in parserfunctions (which we are hoping to fix here very soon, as soon as Tidy can be installed). But I made a text test version (see below). --Splarka (talk) 04:11, 14 October 2006 (UTC)

So is this Winter stuff not worth pursuing? Also, I do not see the recursion. Tile calls Tile/Quant which calls Tile/Quant/1. Will (talk -- contribs) 05:22, 14 October 2006 (UTC)


 * This has been here quite some time without reply (and your email has been equally stuck without answer). It looks like this stuff is just taking templates much further than anyone here can help with - and possibly much further than they were ever indended to be taken.  The best advice I can give is to try asking for help from the MediaWiki community at Help talk:Template or the MediaWiki mailing list] -- sannse (talk) 08:34, 9 November 2006 (UTC)

I just thought of something. Every template that provides a sample is recursive. Those templates succeed in recursing. Why not mine?

Because I was testing with non-recursive versions, the recursive version is now at w:c:ChristianMusic:Template:Box Set Indexer Test/Volume Cell and w:c:ChristianMusic:Template:Box Set Indexer Test. Compare that with w:c:ChristianMusic:Template:I am a Moderator. Will (talk -- contribs) 05:00, 14 December 2006 (UTC)