Recreating @enumerate-and functionality

Hi there,

I have a dual-language document I am treating as single-language in C9. I wanted to use the @enumerate-and function, but realized I cannot use it in the “German” part of the document - @enumerate-and will only show the translated “und” instead of “and” if the document is set to German in C9, which I am avoiding.

So, I set out to recreate @enumerate-and without using the special function. Here is the working solution I came up with:

I decided that for lists of names longer than 6, the user would need to go in manually.

I am wondering if there is a more streamlined way to do this instead of writing out every option?


If you want to build this manually, I would suggest doing it as follows:

@for(?X, #eip^_partner, @ITEM)

?X{?INDEX < (@count(#eip^_partner) - 1):,}{?INDEX = (@count(#eip^_partner) - 1): und | ?INDEX = @count(#eip^_partner):.}

The main improvement is that you can use this with an unlimited number of elements.

If you would need to be able to use this in multiple contexts, you could make it an external snippet, replacing the datafield #eip^_partner in the above syntax with a parameter, e.g. ?DATA and then passing it through in the external snippet reference (e.g. @#enumerate-und(?DATA := #eip^_partner)).

Of course, it is strongly advised to just use the multi-language functionality built into Clause9 but the above gives you ways of replicating the enumeration functionality in a single language context.

1 Like