[ic] PREFIX-alternate N doesn't handle nested else's properly...

Jeff Carnahan interchange-users@lists.akopia.com
Wed Jun 27 02:12:00 2001


I've found another issue with IC 4.6.5, concerning the [PREFIX-alternate N]
tag. It doesn't seem to like [if]'s with [else]'s nested within it.

i.e.:

[loop arg="1 2 3 4 5 6 7 8 9 10"]
    [loop-alternate 2]
        EVEN
    [else]
        ODD
    [/else]
    [/loop-alternate]
[/loop]

<P>

[loop arg="1 2 3 4 5 6 7 8 9 10"]
    [loop-alternate 2]
        [if type="explicit" condition=`[loop-code] < 5`]
            EVEN, < 5
        [else]
            EVEN, > 5
        [/else]
        [/if]
    [else]
        ODD
    [/else]
    [/loop-alternate]
[/loop]

The first example works as it should, however with the second example,
[loop-alternate 2] believes that the [else] .. [/else] block nested within
the [if] tag specifies what to display when an odd number is encountered.

For now, I'm using the following workaround:

[loop arg="1 2 3 4 5 6 7 8 9 10"]
	[loop-alternate 2]
		[if type="explicit" condition=`[loop-code] < 5`]
			EVEN < 5
		[elsif type="explicit" condition=`1`]
			EVEN > 5
		[/elsif]
		[/if]
	[else]
		ODD
	[/else]
	[/loop-alternate]
[/loop]

I haven't tested to see if 4.7.x suffers from this problem as well.

--
Jeff Carnahan - jcarnahan@networq.com