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)