The flatorder
tag directly modifies option ordering in a list built from multiple collections. The hierarchy of collections is "flattened," so each individual list element can be directly referenced.
Syntax
flatorder: order string or shorthand
Examples
Ordering lists with multiple collections
In the following example, the ANIMALS list is composed of three collections: the DOGS list, the CATS list, and the Guinea Pig option. The order: [*]
tag will randomize the order of these collections, and the order of the items within the collections; however, the items in each collection will not be mixed together.
To instead randomize all the options together as a single collection, use flatorder
as shown in this example. The collections are "flattened" into a single collection and randomized accordingly.
Ordering lists with collection headers
If we want to randomize just the Cats collection, and always show the Other collection first, we might be inclined to order the Cats list separately, then use an order tag on the ANIMALS list.
setlist: DOGS _A. Dogs 1. Pug 2. Dalmatian 3. Boxer setlist: CATS order:[*] _B. Cats 4. Bengal 5. Serval 6. Siamese setlist: ANIMALS order: 3,[1,2] optsfrom: DOGS optsfrom: CATS _X. Other 7. Guinea Pig
It is also possible to accomplish the same thing with a flatorder
tag on the ANIMALS list. This might be convenient if the original Cats list ordering needs to be preserved for usage elsewhere.
setlist: DOGS _A. Dogs 1. Pug 2. Dalmatian 3. Boxer setlist: CATS _B. Cats 4. Bengal 5. Serval 6. Siamese setlist: ANIMALS flatorder: (9,10,[(1,2,3,4),(5,[6,7,8])]) optsfrom: DOGS optsfrom: CATS _X. Other 7. Guinea Pig
Here, we are defining the list order with numerical position references which includes both options and headers. The 9th and 10th list items are the header and option for the Other collection; codes 1 through 4 cover the options and header for Dogs, and 5 through 8 cover the options and header for Cats. Note that despite the randomization scheme for the Cats collection, we've anchored the header (code 5) to the top. If we omit this, the header is randomized and mixed in with the options.
Note: In the flatorder
tag, collection headers themselves occupy a place in the numerical sequence. This is a key difference between order
and flatorder
the order
tag does not do this. Headers accompany their respective collections.
Comments
0 comments
Please sign in to leave a comment.