Formatting names for NeoGroup

Applies to: NeoGroup, GroupBuilder


By default a subject appears in a name list in the conventional 'name format - the firstname plus the lastname separated by a space. Successive names are then separated by a comma and a space.


Figure 1: Group names

Alternative formating can be achieved by making use of the format window in Names Mode. For example, additional fields other than the name fields can be displayed for each subject. This technique is especially useful for handling staff or other subjects who may require a title to be displayed for some groups but not others. With this in mind the use of the format window is possibly best demonstrated by working through a series of examples.

Displaying just the firstname

There may be occasions where just the firstname is to be used in the name list rather than the default full name. This can sometines be the case for kindergarten and pre-school photos.


Figure 2: Entering @firstname into the format window

To use just the firstname simply enter @firstname into the format window as per the screen grab which results in a name list as illustrated below


Figure 3: Displaying just the firstname

Adding fixed text

It is possible to enter fixed text to be displayed with each name. Consider a group photo where all the subjects are males and must have the prefix "Mr." in front of their names. Simpy add this text to the format window along with the @firstname and @lastname fields.


Figure 4: Adding fixed text

The screen grab below shows why entering fixed text is possibly of limited use. Even if all subjects are of the same gender they are unlikely to require the same title! A more practical approach is to place titles in a subject field and call that field with an @ code. This concept is used in the following examples.


Figure 5: The result of adding the fixed text "Mr." to the format window.

Using a Title field

A very common approach is to add a title for a subject to a subject field. The field can then be called onto a group using the format window only for the groups that require the total. This means that teachers for example can have their title included on the class photo but not the staff photo.


Figure 6: Adding an @title field to the format window

The screen grab below shows both the benefits and limitations of this technique. By adding @title, the teacher Christopher Thompson, has the contents of his Title subject field added to the name list. The other subjects not having anything in the Title field display without a title. But note the limitation. In actual fact what was added to the format window was @title followed by a space so that the name is displayed as Mr. Christopher Thompson not Mr.Christopher Thompson. This presents a problem because while the remaining subjects do not have a title, the space is a fixed character and is applied to every subject.


Figure 7: Extra space between names resulting from using @title @firstname @lastname

The situation is exacerbated is using other fields in addition to the title field. Commonly a "position" field is used to describe the staff members role - teacher,principal, assistant teacher for example. Placing @title @firstname @lastname @position into the format window would result in the following.


Figure 8: Extra spaces between names resulting from using @title @firstname @lastname @position

The above problem is resolved by making use of conditional text as described in the following examples. (For more information about the use of conditional text please refer to Conditional Text

Conditional text

The general principle of conditonal text is as follows:

Upon encountering a { character, everything up to the upright bar | becomes a condition. If the condition is true i.e. has a value, everything after the upright bar | is used. If no text results from the condition (i.e. the condition is false) everything after the upright bar is ignored.

The format window therefore looks like the screen grab below.


Figure 9: Using conditional text. Note the space after the title field and before the position

Thus by making the spaces part of the condition they will only be added if the subject has data in the title and/or position fields. This results in the correct handling of the title and position fields and the spaces after and before them as can be seen below.


Figure 10: Correctly displaying title and position

Nested conditions

Conditions can be nested to provide even more complex name formatting. Consider the situation where a teacher's name is to be displayed with just firstname and last name in a staff photo, title and position in the class photo but title, initial and name in some other groups. For example:

  • Christopher Thompson
  • Mr. Christopher Thompson (Teacher)
  • Mr. C. Thompson

We have seen how the first two formats can be achieved. The third can be achieved by making use of nested conditions


Figure 11: Nested conditions

In the example above the condition is the @title field. If the condition is true (the subject has a value in the Title field) it will use what comes after the first upright bar - @title @firstinitial. If the condition is untrue (the subject has no value in the Title field) it will do what comes after the next upright bar - @firstname.

The result is displayed below


Figure 12: Using the first initial for just the teacher

Name prefix and suffix

Version 4.4 introduced the ability to add a prefix and a suffix to group names 'on the fly'. This is done directly in Names Mode where each name can be assigned a prefix and/or suffix as desired.


Figure 13: Assigning a prefix and suffix.

The prefix and suffix apply to the name in the current group only. As such their use provides maximum flexibility in handling titles and positions. Consider the many examples above where a Title field and Position field are used for staff members. This works well in most cases but cannot be used for situations where the teacher has different positions depending on the group. A teacher's position may be "Teacher" for the class photo, "Vice Principal" in the staff photo and 'Coach" in the football team photo. A single "Position" field in Details Mode could only hold one position and having multiple "Postion" fields is not practical. By using the suffix window in Names Mode the teacher can have a different position for each of his groups.


Figure 14: Assigning a prefix and suffix.

The prefix and suffix can also be used in the format window using the following tags:

  • @name-prefix
  • @name-suffix

This means the prefix and suffix can be used with other name formatting including conditions such as:

@name-prefix @firstinitial. @lastname{@name-suffix| (@name-suffix)}

End of article


Recent Discussions

14 Aug, 2018 02:48 PM
03 Aug, 2018 03:05 PM
12 Jul, 2018 12:16 PM
03 Jul, 2018 06:01 PM
07 Jun, 2018 05:43 PM