Involvements - TenthPres/TouchPoint-WP GitHub Wiki

Small Groups? Classes? List and manage any kind of involvement.

Setup & Usage

To enable, go to Settings > TouchPoint-WP > Basic Settings and select "Enable Involvements."

Involvements are imported to WordPress based on the Program/Division they belong to, and are imported as any number of separate post types. Two sample post types we'll reference throughout this guide are "Small Groups" and "Sunday School Classes".

You will probably have two default Involvement Post Types by default, which you can adapt to your needs. Or, you can create a new one.

If you want to show the names of you Involvement leaders (e.g. small group leaders), you must also enable the People Lists feature.

Most of the settings should be fairly self-explanatory. A few highlights:

Divisions to Import

You can import any number of divisions into a single Involvement Post type, and each Division can be imported into multiple Involvement Post Types if you need that. However, we recommend keeping the structure pretty boring. We use one Division for each Involvement Post Type, "Small Groups" for Small Groups, and "Adult Bible School" for our adult classes.

Campuses to Import

Only useful if Campuses are enabled. Only involvements from the selected campuses are imported. "(No Campus)" includes involvements that don't have a campus.

Import Hierarchically (Parent-Child Relationships)

If an involvement's parent involvement is imported into the same post type, the involvement's page is placed under its parent's page, and the parent lists its child involvements. Otherwise, every involvement is listed on its own. See the TouchPoint documentation for more on Parent/Child Involvements.

Import Images from TouchPoint

Imports each involvement's image from TouchPoint (Registration > Mobile/Sites) as the featured image of its page, and of its meetings' pages. Side-loading images in this way can sometimes cause conflicts with image optimization plugins. If you have trouble, try turning this off.

Import All Meetings to Calendar

Only shown when the Meeting Calendar is enabled. Imports every meeting of this post type's involvements under each involvement's page. Involvements that have "Show in Sites" checked will be featured on the calendar.
See Meeting Calendar for how meetings become pages, and how related meetings can be grouped together.

This only applies while the Meeting Calendar is enabled. If you turn the calendar off, no meetings are imported for the post type, including those of involvements that have "Show in Sites" checked. Meetings are still used to describe each involvement's schedule. Your choice is kept, even though the box can't be seen, and applies again if you turn the calendar back on.

Exclude Involvements if

Involvements that match any checked condition aren't imported, even if they're in a selected Division. An excluded involvement that was imported before is removed from your site, along with its meetings' pages, including archived ones.

  • Involvement is Closed: its registration is closed in TouchPoint.
  • Involvement is a Child Involvement: it has a parent involvement. This doesn't affect child involvements whose meetings are included in their parent through meeting grouping.
  • Involvement does not meet weekly: the involvement's "Does not meet weekly" setting is checked in TouchPoint.
  • Involvement does not have a Schedule: non-recurring meetings can be excluded by checking this box. This feature is deprecated because of changes to how schedules are managed within TouchPoint and will likely be removed in the future.
  • Involvement has a registration type of "No Online Registration".
  • Involvement registration has ended: its registration end date has passed.

Use Geographic Location

If geography is relevant (e.g. Small Groups that meet in homes throughout the area), check this box to import geographical information and enable mapping.

Leader Member Types

Select the Member Types for people who should have their name visible on the class. At Tenth, we have two Member Types we use for Small Group Leaders: "Leader" and "Leader + Host". The "Contact Leader" button will create a task assigned to one of these people.

Host Member Types

Only visible if Use Geographic Location is enabled. Select the Member Types for people who should have their home address used for the map marker. At Tenth, we have two Member Types we use for Small Group Hosts: "Host" and "Leader + Host". The "Host" does not have their name on the group, but their home address is used for the group's location. The "Leader + Host" both has their name on the group and also has their home address used for the group's location.

Default Grouping

Divides this post type's list of involvements into sections: Upcoming, for involvements whose first meeting is still in the future, and Current, for the rest. Choose which section comes first, or "No Grouping" for one list. Sections are only shown when both have involvements, and only on lists of a single post type.

This is about lists of involvements, and isn't related to meeting grouping.

Images

If an Involvement doesn't have an image of its own in TouchPoint, it uses its parent Involvement's image (or its grandparent's, and so on) when it's displayed. Nothing is copied, so if the parent's image changes, the children follow it. Meetings and events that are past Archive After Days keep the image they had, and don't pick up a newer one.

Titles in Lists

When an item is listed on the page of its parent, and its title starts with the parent's title followed by a colon, dash, bar, or similar, the parent's title is left out of the list. For example, "Global Outreach Conference: Q&A Luncheon" is listed as "Q&A Luncheon" on the Global Outreach Conference page. Only the list is affected. The title stored on your site, the item's own page, and the calendar all keep the full title. Titles that don't follow that pattern, such as "GO Conference Midweek Service", are left as they are.

If your theme has its own copy of the list-item templates, print $inv->titleInList() for an item's title, and $childInv->titleWithinParent($post) for a child listed inside it, to get this. Both are available on Involvement and Meeting objects. New pages' addresses are also made from the shortened title, so "Global Outreach Conference: Q&A Luncheon" gets the address q-a-luncheon under the conference, not a date. Pages that already exist keep their addresses.

Default Filters

On the Involvement listing pages (an Archive page, in WordPress terms), you can have a Filter bar which allows the user to narrow the options based on certain criteria. Which filters are available can be changed via shortcode parameters, or you can set some defaults. The demographic items on this list (Prevailing Marital Status and Age Group) are based on the actual Marital Statuses and Age Groups of the members of the Involvements.

Contact Leader Keywords

When someone clicks the Contact Leader button, a task is created with the user's message and these keywords.

Join Task Keywords

When someone clicks the Contact Leader button, a task is created with these keywords to encourage the leader to reach out to the prospective member. If the Involvement has a registration (meaning, it has registration questions or a registration type other than "Join Involvement"), no task will be created and the "Join" button is replaced with some version of a "Register" button.

Shortcodes

In addition to the Archive pages that list involvements, there are also a few special shortcodes.

TP-Inv-Nearby

Use this shortcode to list the Involvements of a particular type that are closest to the user's location. At Tenth, we use this for a "Small Groups Nearby" section on our homepage.

Parameters

  • type - string - Required. The Involvement type that should be listed.
  • count - int - The number of Involvements to list. Defaults to 3.

Example

This example shows the three nearest smallgroup involvements to the user.

[TP-Inv-Nearby count=4 type="smallgroup"]

TP-Inv-List

Use this shortcode to list involvements that match particular criteria. At Tenth, we use this to show Small Groups that are affiliated with a specific ministry on that ministry's separate page.

Parameters

  • type - string - Required, unless the page is an Involvement archive page. Use this field to specify the Involvement type that should be listed.
  • div - int - If you would like to filter the list down to only show involvements from one division, put the division ID here.

Example

This example shows the Involvements of the 'inv_smallgroup' type which are also in Division 18. At Tenth, this is College ministry Small Groups.

[TP-Inv-List type=inv_smallgroup div=18]

Filters

tp_involvement_actions

Use this filter to change the generated HTML for actions on an Involvement. The parameters are:

  1. The existing string after it's generated
  2. The Involvement object, which can be used for fetching other details
  3. An optional Context variable which is passed from the Involvement::getActionButtons($context)

tp_inherit_thumbnail

Use this filter to prevent a post from inheriting its parent's image. Return false to leave the post without an image. The parameters are:

  1. Whether the image will be inherited (true by default)
  2. The post that doesn't have an image of its own
  3. The ID of the post the image would come from
  4. The attachment ID of the image that would be used
// Don't inherit images on Small Groups.
add_filter('tp_inherit_thumbnail', function (bool $inherit, WP_Post $post): bool {
    return $post->post_type === 'tp_smallgroup' ? false : $inherit;
}, 10, 2);

tp_title_within_parent

Use this filter to change the title that's displayed for an item in its parent's list, or to keep the full title. By default, the parent's title is removed from the start of the item's title if a separator follows it. The parameters are:

  1. The title to display
  2. The item's post
  3. The parent's post
  4. The item's full title
// Use the full title in lists.
add_filter('tp_title_within_parent', function (string $title, WP_Post $post, ?WP_Post $parent, string $fullTitle): string {
    return $fullTitle;
}, 10, 4);

// Handle an abbreviated parent title.
add_filter('tp_title_within_parent', function (string $title, WP_Post $post, ?WP_Post $parent): string {
    return str_starts_with($title, 'GO Conference ') ? substr($title, strlen('GO Conference ')) : $title;
}, 10, 3);

tp_adjust_time_string

Use this filter to adjust how time strings are rendered dynamically. The value passed to the filter is the time string as provided. There is one argument provided, which is an object that implements the DateTimeInterface representing the time needing to be put into a string. (For example, we use this to remove :00, so times like 7:00pm becomes 7pm.)

tp_inv_allow_contact

Use this filter to prevent "Contact Leader" option from appearing. Return false to prevent contact buttons from appearing. The Involvement Post Type is provided as a parameter.

tp_allow_contact

Use this filter to prevent "Contact Leader" option from appearing on Involvements AND also prevent "Contact" button from appearing on People Lists. Return false to prevent contact. There is no parameter provided. The example below is what we use to prevent contact from outside the US to reduce spam.

function tenth_allowContact($value): string
{
    // Prevent public caching, unfortunately.
    \tp\TouchPointWP\TouchPointWP::doCacheHeaders(\tp\TouchPointWP\TouchPointWP::CACHE_PRIVATE);
    $country = $_SERVER['HTTP_CF-IPCountry'] ?? null;

    if ($country === null) {
        $geoObj = \tp\TouchPointWP\TouchPointWP::instance()->geolocate(true, true);
        $country = $geoObj->raw->country_code ?? "";
    }

    if (!in_array($country, ['US', 'T2'])) {
        return false;
    }

    return $value;
}
add_filter('tp_allow_contact', 'tenth_allowContact');