This page created 11 Jul 2011
Version note: Applies to Second Site 6 & 7
Flag Events allow one to create text output, as you would normally obtain from Tags, but based on Flags. This article explains that feature and offers some suggestions for its use. Other articles in my Second Site Section cover other topics about customizing your site.
Topics Included in this Article
|Outputting the Flag value itself|
|More complex output based on Flags; notes, links, and more|
|Defining Flag Events|
|Controlling how Flag Events appear on your site|
Flags, of course, are simple data structures in TMG, in which one can assign a single value, say Y, N, or ? for Living, or M, F, or ? for Sex, to cite two commonly used standard Flags (see my article on Flags for more information). Users can create custom Flags for any desired purpose, provided the information to be stored can be accommodated with a single character. One of the more popular custom Flags are various forms of "Related-by" flags, which record how each person is related to a base person (see my Creating a "Related-by" Flag article). But users have devised an endless variety of ways to use Flags record information of interest to them about the selected people in the Project.
Flag Events created in Second Site are treated within Second Site the same as traditional events based on Tags in TMG. They can be output in any way a Tag Event can be output, and the same controls that govern which events appear and how they appear apply.
The most obvious way to use Flag Events is probably to output the value of the individual Flags. This is an improvement over enabling the Custom Flags item in the Pages > Person Entry section, the long-standing way to display Flags in Second Site. That feature lists all custom Flags at the selected location in each person's entry on the Person Pages, with output limited to the single-letter value of the flag.
With Flag Events one can choose which Flags are to be output, and output either the single-letter value of the Flag or an expanded version of it. For example:
In this example, the single-letter value if the Immigrant Flag is output, while the value of the Related-by Flag is translated to text which is more readily understood. Creating this kind of output from Flags is described fully in Help – go to the Data > Flags section and press F1 to view the correct Help page.
Flag Events can be positioned and formatted in a variety of ways, rather than just a list at the top or bottom of the Person Page section, as described below.
Flag Events can be used to create much more complex output than simply the value of the Flag itself. They are an excellent way to add specific text, including links to other pages, to a selected group of people. For example, you might want to display a note for all first cousins and beyond, or second cousins and beyond, that says something like "This person is a distant cousin for whom I have done only limited research." Since it would be controlled with a flag, it could be applied flexibly, for example it could be omitted for those few cousins for whom you have done a lot of research.
Or, one might want to display an icon or image for a specific group of people. For example, an image of a map showing the general route of those who immigrated from a specific country or region. You can use the Icon feature to display small icons based on Flag to the names of people in Indexes, their Person Page entry, or in the lists of children (see my Using Icons article for details). Using Flag events you can attach larger icon or other types of images, and place them in a variety of locations within each person's Person Page entry.
Yet another application for Flag Events is to create links in the Person Page entries of specific people to another page in the site, or even to another site altogether. I use a Flag Event to provide a link to a custom page containing background information on a person's family (see my article Creating Virtual Sub-Sites for an example of this specific application). But the same method can be used to create a link to any page related to a number of people in your site. A similar result can be obtained with traditional TMG event Tags (see my Useful Tricks article), but I think using Flag Events is simpler when a lot of people are involved because you do not have to add or remove actual Tags as you add or remove people from the group. Instead you simply change the value of the Flag used to create the Flag Event for those people. You could also use of the Groups feature in Custom Indexes (see my article on Creating Custom Indexes), but using Flag Events separates the links from the Index, which may be desirable in some cases, and allows more flexibility in formatting and positioning the link.
To use Flag Events to add text, images, or links to specific people, you would generally create a custom Flag in TMG. Typically the Flag would have values of Y and N, and you would set the Flag to Y for those people for whom the text is to appear in Second Site.
If you plan to do that for only a very few people you can set the Flag for them individually. But if you want to include a larger number you should use the Secondary Output of the List of People report to set the Flag for the desired people. You can collect the people you want to include in a Focus Group, then use the List of People report to set the Flag based on the Focus Group. Or, you can use a Filter in the List of People report. Often several passes with the List of People report and Filters are required. See my article on Filters for some tips on collecting the people you want to specify.
Once you have marked the desired individuals with a Flag in TMG, in Second Site go to the Data > Flags section to create the Flag Events based on it. The following discussion uses as an example a Flag Event that creates links to a family background page for specific people, in the site. A similar Flag Event would be created for each different family that has such a background page.
The first step is to click the Add button to open the Edit Flag Events screen:
On the Edit Flag Event screen I've entered data in these fields:
Title – Enter anything that describes this event. The Title is used only to identify this event in the list of events in the Data > Flags section.
Flag – Select the Flag to be used for this event. Under the Flag drop-down I set the second drop-down to Include.
Values – I entered Y, so that the event will appear for people with this Flag set to Y.
Label – I entered the Label "Family." The Label serves the same purpose as the Label in Tag Types in TMG. It can be used to select the event for output in a Tag Group as described in the "Formatting and Positioning" section below. It can be part of the output, depending on the Format being used. The Label should generally not be the same as the Label of any normal Tags in your Project.
Memo – Is used like the Memo field in TMG Tags. It can contain text, Sentence variables, HTML, and Second Site scripts. It can be output by use of the Sentence as done here, or by use of the various methods that allow output of Memo text without use of the Sentence. In this case I've entered HTML codes to produce a link to a custom page (for more on creating links in this way see my Useful Tricks article).
Sentence – Is used the same as the Sentence in TMG Tags. If you specify that Sentences are to be used in your site the Sentence will control the output from this event. In this case I specified only that the Memo be output, combined with a Tab code to indent the text, a Carriage Return code to separate multiple events when more than one of these events appear for a single person. I added the [:NP:] code to suppress the period that would other wise be automatically generated because in this application it was not needed.
I did not use the Role, Date, or Sort Date fields, but they can be used, and can be output the same as those fields in a TMG Tag event.
The output of this Flag Event is highlighted by the red box in the example below:
The positioning of this event and the section header are provided by the Tag Group function, as discussed below.
Flag Events can be included in Person Page sections for each person like any regular Tag events which apply to that person. Depending on the Format you use for your site and the nature of the output your Flag Events are designed to produce, it may work well to simply include them with other events. You can assign Sort Dates to position them relative to other events, but since a single Sort Date applies to every person for whom the Event will appear, as a practical matter this means they can only be positioned as first or last among other events.
More commonly one would want the output of Flag Events set off from other events, as in the example above. Even for outputting just the Flag values you may want to set them off in a box as illustrated in the Help page referenced above. Formatting the output of these Events differently from the rest of the text, positioning it in specific ways, and enclosing it in a box are all possibilities that can be accomplished by use of the Tag Groups feature. That feature is described in my Tag Groups article.
|ReigelRidge Home||Terry's Tips Home||Contact Terry|
The Second Edition of my sell-out book, A Primer for The Master Genealogist, is still available.
Details are can be seen here.
Copyright 2000- by Terry Reigel