Advanced Customizing WebPublicPerson - TenthPres/TouchPoint-WP GitHub Wiki

The WebPublicPerson.py script controls the information that is sent to WordPress.
This allows you to exclude some people or manipulate the data before it's released to WordPress (and potentially the public internet). We use this to exclude the last names from some Global Partners.

There are three variables that are used: Data.Person, Data.Info, and Data.Context

Data.Person

This is the Person object direct from TouchPoint. Its attributes are documented in the documentation and the code repository. Use this object to get information from the Person's record to customize.

Data.Info

This is the object that gets returned to WordPress. It has the following attributes and default values:

  • Exclude - bool - Default: False. Setting this to True will prevent this person from being included in the public website completely. This means no user account will be created for them on WordPress and they will be excluded from any People Lists.
  • DecoupleLocation - bool - Default: False. For Partners only. Setting this to true will unlink the marker on the map from the partner. That is, you can have a marker on the map, and a listing apart from the map, but the location is disconnected from the listing. This is intended for creative access situations.
  • GoesBy - string - Default: NickName if the Person has one, otherwise FirstName. This becomes the First_Name field in WordPress.
  • LastName - string - Default: LastName. Becomes the Last_Name field in WordPress.
  • DisplayName - string - Default: GoesBy + " " + LastName. Becomes the Display_Name field in WordPress.

Data.Context

This indicates which part of TouchPoint-WP is querying the person information. The value will be one of these strings:

  • ident is used for RSVP and Contact modals.
  • partner is used for global partner families (or organizations) that are imported.
  • users is used for users that are imported upon login or another sync process. Note that because users and peopleLists share their data, these should probably have similar or identical logic.
  • peopleLists is used for syncing users, specifically for People Lists. Note that because users and peopleLists share their data, these should probably have similar or identical logic.
  • src is used when searching for people.

Sample Script

The default script provided gives an example of how we use this to manage which situations include kids, and how to manage the names of our Global Partners.

Kids are excluded from everything except "ident".

Our global partners have a Family Extra Value (Int) for their Security Level which causes individuals to be handled as follows:

  1. No special precautions. Full names are printed, everything is synced.
  2. Display full first names, but not last names.
  3. First initials only. Not last names.
  4. Exclude completely.
⚠️ **GitHub.com Fallback** ⚠️