You do not usually need to understand about Item Groups as Family
Historian will create them for you automatically when you add items from
the list into the list in the Edit Text Scheme Dialog. However, some
understanding of what groups are, and how they are used, may be helpful
if you move parts of a text scheme around using the Move Up
and Down
arrows. You can
move items within a group, but moving an item out of a group, or
changing the first line of a group, will not usually have desirable
results (and it’s easy to do). Also, if you want to change the font used
within a group, it is helpful to have some understanding of what groups
are, and what they’re for.
It is easy to recognize a group in the listing of items used in a text scheme (see Edit Text Scheme Dialog). All the lines items in the group (except the first) have a bent arrow pointing back up to the previous line, like this:
Occupation, age at
Occupation Notes
Death Cause
Death NotesIn this example, there are 2 groups. The first group consists of the Occupation line and the 2 lines that follow it. The second group consists of the Death line and the 2 lines that follow it.
A group is formed when you tick the Group with previous line box in a Text Scheme Item (in the Edit Text Scheme Item Dialog). That item then forms a group with the previous item (and in the listing it has the bent arrow to the left of its entry). If the previous item also has Group with previous line ticked, the group includes the item before that too, and so on until you reach an item where this box has not been ticked. This item - that is, the first item in the group - sets conditions for the group as a whole. If the conditions for the first line of a group are not met, the other items within the group will not be output, even if their conditions are met.
The main reason for forming a sequence of items into a group is if you wish them to repeat for all instances of the data in question.
An item in a text template typically corresponds, to a single type of data. For example, an item might show a person’s occupation. Sometimes, as in the example above, you may want several items relating to a single event or attribute, however. For example, you might have one line for a person’s occupation, and another line again for the person’s age at the time of the occupation, and perhaps another line (another item) for any notes about that occupation. So the part of a box that relates to a person’s occupation might look like this:
But what if a person had multiple occupations? Do you need multiple items - one for each possible occupation? The answer is that you don’t. You can specify a single item to repeat, so that it shows all instances of a given item of data. And you do not need a group to do this. But what do you do if you have multiple items which all relate the same thing, such as a person’s occupation and you want them all to repeat? The answer is that you form them all into a group. That way, the entire group can repeat. In the example below, the person has 3 occupations:
As previously stated, the first line in a group sets conditions for the group as a whole. A group does not necessarily have to loop - that is, repeat for all instances of the data item in question. Whether or not it does loop is determined by the template for the first group item (see Understanding Text Templates). Although the first line of a group does not have to be a standard data item, the group will not repeat for all instances if it doesn’t; so it is usually better to ensure that it is. It is not recommended that you start a group with a font change, for example.
If you wish, you can change the font within a group. A common requirement is to use one font for the first line of an item group, and use a different font, or font style, for all the other lines, to make them stand out. To do this you must add font changes into the group, like this:
<font=Arial, 8 pt,
italic; text colour is Teal>
Occupation, age at
Occupation, Notes
<font=Arial, 8 pt;
text colour is Black>This could be used to give this kind of effect:
You need to use the Move Up/Down arrows to position the font change items correctly. Also, you need to double-click on each, and tick its box to make it part of the group.
Note that the group contains 2 font changes: one to switch the font to teal (a shade of green) and italics; and another to reset it back to black, with no italics. If you don’t include the second font change item as part of the group, the change of font will persist from then on, and the result would look like this:
which is presumably not what you want.
When you move a group, using the Move Up/Down arrows in the List in the Edit Text Scheme Dialog, make sure that you move all parts of the group at the same time. To select them all, click on the first item, then press-and-hold the Ctrl key while clicking on other items to select them all. It is very easy, when using the Move Up/Down buttons to break up a group. But you are unlikely to get sensible results if you do.