Participant Center 3 Customization

Customizing Participant Center 3 (PC3) is entirely optional, but should you want to change the default version, files are available for the customization.

Administrators can customize each instance of the Participant Center for these customizations:

Customizable files contain comments with example code for customizing PC3 in a variety of common ways. To access the files, administrators edit each instance of the Participant Center configured on their site.

Custom Styles

Participant Center 3 styles are based on Bootstrap CSS 3.3.7. Many components share styles or have a series of identifiers to specify the elements that gather those styles.

The custom.css file loads after the main styles. The easiest way to override an existing style is to use developer tools to identify the identifiers currently declared for the style of that element and use those same styles in the custom.css file to create the override.

For example, the background-color style for the active button in the top navigation bar uses the following set of identifiers:

.ng-pc-container .nav-pills>li.active>a,
.ng-pc-container .nav-pills>li.active>a:focus,
.ng-pc-container .nav-pills>li.active>a:hover,
.ng-pc-container .nav-pills>li.active>a:link,
.ng-pc-container .nav-pills>li.active>a:visited,
.ng-pc-container .nav-tabs>li.active>a {
background-color: #337ab7;
color: #fff;
font-weight: 600;
}

To change the background-color, you would add the same declaration to the custom.css file with a modified value for the background-color.

Custom Internet Explorer Styles

Because Internet Explorer does not always follow the same standards for CSS as most other browsers, we include a custom_ie.css file just after the custom.css file, loaded only when the browser identifies itself as Internet Explorer.

This allows you to add custom styles that only apply to Internet Explorer and not to any other browser.

Custom JavaScript Functions

The custom.js file loads just before the main JavaScript code for the Participant Center and contains several functions that are called from various sections of the Participant Center JavaScript code.

Examples are provided in the default custom.js file. The information below provides in-depth explanations and examples of these functions.

Function: ngLoadInit

The "ngLoadInit" function executes at the end of the initialization of the Participant Center, before any views load. It passes the "$rootScope" variable, which contains data and services used throughout the Participant Center code. This function is appropriate for loading, storing, or modifying data once when the Participant Center is initialized. You can also use it to define functions to use throughout other views or customizations in the Participant Center.

Function: ngChangeRoute

The "ngChangeRoute" function executes during a route change when transitioning from one view to another, before the new route loads. It passes the "$rootScope" variable, a "redirectRoute" function that can be used to manually transition to a different route, and "next" and "current" variables that define the destination view and the current view. This function is appropriate when adding new views or changing the behavior when transitioning from one view to another. All customizations in this function should be contained within an "if" statement using either the "next" or "current" variables so the customization is only executed during the desired transition.

Function: ngLoadModal

The "ngLoadModal" function executes after a modal window loads to allow customization of the content of the modal window. It passes the "$rootScope" variable, the "$scope" variable that defines the data available within the scope of the modal window, and a "modal" text value that describes which modal window just loaded. This function changes content or behavior within a modal window. Contain all customizations within an "if" statement using the "modal" variable to ensure the change only affects the desired modal window.

Function: ngLoadController

The "ngLoadController" function executes at the end of loading each controller (or "view"). It passes the "$rootScope" variable, the "$scope" variable that contains the data and functions available within the current controller, and a "controller" text value that describes the view that just loaded. This function modifies the behavior or functionality available within a given controller. All customizations should be contained within an "if" statement using the "controller" variable to ensure the customization only affects the desired view.

Function: ngCustomCallback

The "ngCustomCallback" function executes at the end of every API call, before returning the API response to the calling function. It passes the "$rootScope" variable, a "requestDetails" variable that is a JSON object with all the information sent in the API call, and a "responseData" variable that is a JSON object containing the response data from the API call. This function modifies the response to an API call before it processes. You can modify the "responseData" variable during this function and should always get returned by this function. This information passes back to the original function that made the API call. Contain all customizations within an "if" statement using the "requestDetails" variable so the customization only affects the specific API call.

Variable: $rootScope

The "$rootScope" variable contains data and services that are used throughout the Participant Center code. It is loaded with every controller and passed to every customization function described above. Here is a sample of the information contained within this variable:

  • $rootScope

    • baseUrl: The base URL for the current Participant Center

    • closeSuccessDelay: Numeric value defining the number of milliseconds to display a success message before closing the success message and any modal window containing it. Default value is 5000.

    • eventInfo: Response from the TeamRaiser API getTeamraisersByInfo method for the current TeamRaiser event

    • frId: String containing the current TeamRaiser event fr_id value

    • locale: String containing the locale value for the current session

    • loadingPromises: Array containing promises for API calls, displays the "Loading" message when there are unresolved promises in the array

    • participantRegistration: Response from the TeamRaiser API getRegistration method for the current participant

    • teamraiserConfig: Response from the TeamRaiser API getTeamraiserConfig method for the current TeamRaiser event

    • topNavTabs: An array of objects defining the tabs displayed in the top navigation bar of the Participant Center, where each object contains the following elements

    • order: The numeric order of presentation, with the first tab set to number 0

    • label: The message catalog key or text label for the tab

    • href: The destination for the tab, typically beginning with $rootScope.baseUrl

    • active: A boolean value, defaults to false, to determine if the tab displays as active

    • activeTest(): A function which returns true if this tab should be marked as active, typically based off a test using $location.path(). For example, return ($location.path() === '/home');

    • services: A series of functions for calling various API methods

      • ConstituentService: Constituent API methods

        • getUser(): Calls the Constituent API getUser method

        • listInteractions(params): Calls the Constituent API listInteractions method with any additional parameters specified in the params variable

        • listUserFields(params): Calls the Constituent API listUserFields method with the include_choices=true parameter and any additional parameters specified in the params variable

        • listUserFieldChoices(params): Calls the Constituent API listUserFieldChoices method. The params variable must begin with the required field value for this call, followed by any additional parameters

        • logInteraction(params): Calls the Constituent API logInteraction method with any additional parameters specified in the params variable

        • logSocialShare(params): Calls the Constituent API logSocialShare method with any additional parameters specified in the params variable

        • update(params): Calls the Constituent API update method with any additional parameters specified in the params variable

        • changePassword(params): Calls the Single Sign-On API changePassword method with any additional parameters specified in the params variable

    • ContactService: Address Book Contact API methods and functions

      • addAddressBookContact(params): Calls the Address Book API addAddressBookContact method with any additional parameters specified in the params variable

      • addAddressBookGroup(params): Calls the Address Book API addAddressBookGroup method with any additional parameters specified in the params variable

      • addContactsToGroup(params): Calls the Address Book API addContactsToGroup method with any additional parameters specified in the params variable

      • deleteAddressBookGroups(params): Calls the Address Book API deleteAddressBookGroups method with any additional parameters specified in the params variable

      • getAddressBookGroups(params): Calls the Address Book API getAddressBookGroups method with any additional parameters specified in the params variable

      • getAddressBookImportContacts(params): Calls the Address Book API getAddressBookImportContacts method with any additional parameters specified in the params variable

      • getAddressBookImportJobStatus(params): Calls the Address Book API getAddressBookImportJobStatus method with any additional parameters specified in the params variable

      • importAddressBookContacts(params): Calls the Address Book API importAddressBookContacts method with any additional parameters specified in the params variable

      • deleteTeamraiserAddressBookContacts(params): Calls the TeamRaiser API deleteTeamraiserAddressBookContacts method with any additional parameters specified in the params variable

      • getTeamraiserAddressBookContact(params): calls the TeamRaiser API getTeamraiserAddressBookContact method with any additional parameters specified in the params variable

      • getTeamraiserAddressBookContacts(params): Calls the TeamRaiser API getTeamraiserAddressBookContacts method with any additional parameters specified in the params variable

      • getTeamraiserAddressBookFilters(params): Calls the TeamRaiser API getTeamraiserAddressBookFilters method with any additional parameters specified in the params variable

      • getTeamraiserAddressBookGroupContacts(params): Calls the TeamRaiser API getTeamraiserAddressBookGroupContacts method with any additional parameters specified in the params variable

      • updateTeamraiserAddressBookContact(params): Calls the TeamRaiser API updateTeamraiserAddressBookContact method with any additional parameters specified in the params variable

      • getContactString(contact): Converts data contained in a contact object returned by most API methods into a string suitable for the "Recipients" field of an email, including the contact's first name, last name, and email address

      • addToSelectedContacts(contact): Adds the specified contact to the list of selected contacts

      • getNumSelectedContacts(): Returns a numeric value for the number of contacts currently selected

      • isInSelectedContacts(contact): Returns a boolean value indicating whether the specified contact is currently in the list of selected contacts

      • removeFromSelectedContacts(contact): Removes the specified contact from the list of selected contacts

      • resetSelectedContacts(): Removes all contacts from the list of selected contacts

    • ContentService: Content API methods and functions

      • getMessageBundle(params): Calls the Content API getMessageBundle method with any additional parameters specified in the params variable

      • listSupportedLocales(): Calls the Content API listSupportedLocales method

      • renderSTag(content): Calls the Content API getTagInfo method to render the content specified (typically an S-tag) through the Luminate Online template engine

      • richTextToPlainText(text): Removes rich text formatting from the provided text and returns only the plain text content

      • htmlToRichText(text): Removes html formatting from the provided text and returns only the rich text content

    • LocaleService: Locale functions

      • getLocale(): Returns the locale specified for the current session

      • getCurrencyLocale(): Returns the locale used for currency in the current session

    • LuminateRESTService: REST functions used with Luminate

      • getPageContent(pageBuilderPageName, useCache, arguments): Retrieve a reusable PageBuilder page with the name pageBuilderPageName, as described below in Access Reusable PageBuilder Pages

      • loadScript(url): Create a <script> element on the page with the specified url

      • request(servlet, method, requestData, includeAuth, includeFrId, contentType): Make a request to a Luminate Online API with the specified servlet, method, and requestData. The constituent's authentication information is included if includeAuth is true, and the TeamRaiser's event ID is included if includeFrId is true. The contentType defines the encoding used for the request, and is expected to be multipart/form-data for specific API methods that require such encoding (such as uploadPersonalPhoto). Typically, this request should not be called directly - instead, use one of the other servlet-specific functions included in this service.

      • addressBookRequest(method, requestData, includeAuth): Calls the request function for the CRAddressBookAPI servlet

      • consRequest(method, requestData, includeAuth): Calls the request function for the CRConsAPI servlet

      • contentRequest(method, requestData, includeAuth): Calls the request function for the CRContentAPI servlet

      • teamraiserRequest(method, requestData, includeAuth, includeFrId): Calls the request function for the CRTeamraiserAPI servlet

      • teamraiserFormRequest(method, requestData, includeAuth, includeFrId): Calls the request function for the CRTeamraiserAPI servlet, with the contentType set to multipart/form-data

    • LuminateUtilsService: Utility functions used with Luminate Online

      • ensureArray(data): Returns data in the form of an array if it is not already an array

      • getBaseUrl(): Returns the base URL for the current page

      • getSecurePath(): Returns the secure path for the site

      • getFrId(): Returns the TeamRaiser event id

      • getJanrainEngageAppName(): Returns the app name configured for Janrain on the site

      • getJanrainShareProviders(): Returns an array of share providers configured for use with Janrain on the site

      • isIFrameDetected(): Returns true if the Participant Center is loaded using the S409 tag in a PageBuilder page

      • resizeFrameForCurrentView(): Resizes the Participant Center iframe to fit the enclosing PageBuilder page when loaded using the S409 tag

    • SocialShareService: Social Sharing API methods

      • logShare(userId, provider): Logs a social share interaction for the constituent using the specified provider

      • activateJanrain(elem, sharePage): Activates a Janrain social sharing component within the specified element elem to share the url specified by sharePage

      • initJanrain(): Initialize the Janrain service

    • TeamraiserCompanyService: TeamRaiser Company API methods

      • getCompanyList(): Calls the TeamRaiser API getCompanyList method, including the current TeamRaiser event id automatically in the parameter list, with no other arguments

      • getCompanies(params): Calls the TeamRaiser API getCompaniesByInfo method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • getCompany(): A shortcut to call the getCompanies function described above, including the company_id associated with the current participant's team or individual registration

      • getCompanyPageInfo(): Calls the TeamRaiser API getCompanyPageInfo method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, with no other arguments

      • getCompanyPhoto(): Calls the TeamRaiser API getCompanyPageInfo method, including the current TeamRaiser event id, the participant's authentication information, and the company_id associated with the current participant's team or individual registration automatically in the parameter list, with no other arguments

      • getCompanyShortcut(): Calls the TeamRaiser API getCompanyShortcut method, including the current TeamRaiser event id, the participant's authentication information, and the company_id associated with the current participant's team or individual registration automatically in the parameter list, with no other arguments

      • removeCompanyPhoto(formParams): Calls the TeamRaiser API removeCompanyPhoto method, including the current TeamRaiser event id, the participant's authentication information, and the company_id associated with the current participant's team or individual registration automatically in the parameter list, along with any other data provided in formParams. The formParams variable is expected to be a FormData object, and this request is submitted using the contentType of multipart/form-data, as required by this method

      • updateCompanyPageInfo(params): Calls the TeamRaiser API updateCompanyPageInfo method, including the current TeamRaiser event id, the participant's authentication information, and the company_id associated with the current participant's team or individual registration automatically in the parameter list, along with any other arguments provided in the params variable

      • updateCompanyShortcut(params): Calls the TeamRaiser API updateCompanyShortcut method, including the current TeamRaiser event id, the participant's authentication information, and the company_id associated with the current participant's team or individual registration automatically in the parameter list, along with any other arguments provided in the params variable

      • uploadCompanyPhoto(formParams): Calls the TeamRaiser API uploadCompanyPhoto method, including the current TeamRaiser event id, the participant's authentication information, and the company_id associated with the current participant's team or individual registration automatically in the parameter list, along with any other data provided in formParams. The formParams variable is expected to be a FormData object, and this request is submitted using the contentType of multipart/form-data, as required by this method

    • TeamraiserEmailService: TeamRaiser Email API methods

      • addDraft(params): Calls the TeamRaiser API addDraft method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • deleteDraft(params): Calls the TeamRaiser API deleteDraft method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • deleteSentMessage(params): Calls the TeamRaiser API deleteSentMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getDraft(params): Calls the TeamRaiser API getDraft method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getDrafts(params): Calls the TeamRaiser API getDrafts method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getMessageLayouts(): Calls the TeamRaiser API getMessageLayouts method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getSentMessage(params): Calls the TeamRaiser API getSentMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getSentMessages(params): calls the TeamRaiser API getSentMessages method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getSuggestedMessage(params): Calls the TeamRaiser API getSuggestedMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getSuggestedMessages(): Calls the TeamRaiser API getSuggestedMessages method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • previewMessage(params): Calls the TeamRaiser API previewMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • sendMessage(params): Calls the TeamRaiser API sendTafMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updateDraft(params): Calls the TeamRaiser API updateDraft method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

    • TeamraiserEventService: TeamRaiser Event API methods

      • getConfig(): Calls the TeamRaiser API getTeamraiserConfig method, including the current TeamRaiser event id automatically in the parameter list. A successful response is stored in the $rootScope.teamraiserConfig object

      • getTeamraisers(params): Calls the TeamRaiser API getTeamraisersByInfo method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • getTeamraiser(): Calls the getTeamraisers function above, including a filter to limit results to the current TeamRaiser event based on the event fr_id. A successful response is stored in the $rootScope.eventInfo object

      • getEventDataParameter(params): Calls the TeamRaiser API getEventDataParameter method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • getNewsFeeds(params): Calls the TeamRaiser API getNewsFeeds method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getOrganizationMessage(): Calls the TeamRaiser API getOrganizationMessage method, including the current TeamRaiser event id automatically in the parameter list

      • getParticipationType(params): Calls the TeamRaiser API getParticipationType method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • getParticipantCenterWrapper(): Calls the TeamRaiser API getParticipantCenterWrapper method, including the current TeamRaiser event id automatically in the parameter list

    • TeamraiserGiftService: TeamRaiser Gift API methods

      • acknowledgeGift(params): Calls the TeamRaiser API acknowledgeGifts method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • addGift(params): Calls the TeamRaiser API addGift method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • deleteGift(params): Calls the TeamRaiser API deleteGift method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getGift(params): Calls the TeamRaiser API getGift method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getGifts(params): Calls the TeamRaiser API getGifts method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getGiftCategories(params): Calls the TeamRaiser API getGiftCategories method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • getTeamGifts(params): Calls the TeamRaiser API getTeamGifts method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

    • TeamraiserParticipantService: TeamRaiser Participant API methods

      • createFundraiser(params): Calls the TeamRaiser API createAndLinkFacebookFundraiser method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • confirmFundraiser(): Calls the TeamRaiser API confirmOrUnlinkFacebookFundraiser method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getParticipants(params): Calls the TeamRaiser API getParticipants method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • getParticipant(): Calls the getParticipants function described above, with results filtered to only return the current participant in the current event

      • getPersonalPageInfo(): Calls the TeamRaiser API getPersonalPageInfo method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getPersonalMediaLayout(): Calls the TeamRaiser API getPersonalMediaLayout method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getPersonalPhotos(): Calls the TeamRaiser API getPersonalPhotos method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getPersonalVideoUrl(): Calls the TeamRaiser API getPersonalVideoUrl method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getProgress(): Calls the TeamRaiser API getParticipantProgress method, including the current TeamRaiser event id automatically in the parameter list

      • getShortcut(): Calls the TeamRaiser API getShortcut method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getSurveyResponses(params): Calls the TeamRaiser API getSurveyResponses method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with use_filters=true and any other arguments specified in the params variable

      • removePersonalPhoto(formParams): Calls the TeamRaiser API removePersonalPhoto method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other data provided in formParams. The formParams variable is expected to be a FormData object, and this request is submitted using the contentType of multipart/form-data, as required by this method

      • updatePersonalMediaLayout(params): Calls the TeamRaiser API updatePersonalMediaLayout method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updatePersonalPageInfo(params): Calls the TeamRaiser API updatePersonalPageInfo method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updatePersonalVideoUrl(params): Calls the TeamRaiser API updatePersonalVideoUrl method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updateShortcut(params): Calls the TeamRaiser API updateShortcut method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updateSurveyResponses(params): Calls the TeamRaiser API updateSurveyResponses method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • uploadPersonalPhoto(formParams): Calls the TeamRaiser API uploadPersonalPhoto method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other data provided in formParams. The formParams variable is expected to be a FormData object, and this request is submitted using the contentType of multipart/form-data, as required by this method

    • TeamraiserRegistrationService: TeamRaiser Registration API methods

      • getRegistration(): Calls the TeamRaiser API getRegistration method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list. A successful response is stored in the $rootScope.participantRegistration object

      • getRecentActivity(): Calls the TeamRaiser API updateShortcut method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getWhatNext(): Calls the TeamRaiser API updateShortcut method, including the current TeamRaiser event id automatically in the parameter list, along with the show_all_suggestions=true argument

      • updateRegistration(params): Calls the TeamRaiser API updateRegistration method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updatePersonalPagePrivacy(params): Calls the TeamRaiser API updatePersonalPagePrivacy method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

    • TeamraiserTeamService: TeamRaiser Team API methods

      • getCaptainsMessage(): Calls the TeamRaiser API getCaptainsMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getTeams(params): Calls the TeamRaiser API getTeams method, including the current TeamRaiser event id automatically in the parameter list, along with any other arguments specified in the params variable

      • getTeam(): Calls the getTeams function described above, with results filtered to return only data about the participant's current team in the current TeamRaiser event

      • getTeamCaptains(): Calls the TeamRaiser API getTeamCaptains method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getTeamPageInfo(): Calls the TeamRaiser API getTeamPageInfo method, including the current TeamRaiser event id, the participant's authentication information, and the team_id of the participant's current team automatically in the parameter list

      • getTeamPhoto(): Calls the TeamRaiser API getTeamPhoto method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • getTeamRoster(params): Calls the TeamRaiser API getTeamRoster method, including the current TeamRaiser event id, the participant's authentication information, and the team_id of the participant's current team automatically in the parameter list, along with any other arguments specified in the params variable

      • getTeamShortcut(): Calls the TeamRaiser API getTeamShortcut method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • joinTeam(params): Calls the TeamRaiser API joinTeam method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • leaveTeam(): Calls the TeamRaiser API leaveTeam method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list

      • removeTeamPhoto(formParams): Calls the TeamRaiser API removeTeamPhoto method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other data provided in formParams. The formParams variable is expected to be a FormData object, and this request is submitted using the contentType of multipart/form-data, as required by this method

      • setTeamCaptains(params): Calls the TeamRaiser API setTeamCaptains method, including the current TeamRaiser event id, the participant's authentication information, and the team_id of the participant's current team automatically in the parameter list, along with any other arguments specified in the params variable

      • updateCaptainsMessage(params): Calls the TeamRaiser API updateCaptainsMessage method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updateTeamInformation(params): Calls the TeamRaiser API updateTeamInformation method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updateTeamPageInfo(params): Calls the TeamRaiser API updateTeamPageInfo method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • updateTeamShortcut(params): Calls the TeamRaiser API updateTeamShortcut method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other arguments specified in the params variable

      • uploadTeamPhoto(formParams): Calls the TeamRaiser API uploadTeamPhoto method, including the current TeamRaiser event id and the participant's authentication information automatically in the parameter list, along with any other data provided in formParams. The formParams variable is expected to be a FormData object, and this request is submitted using the contentType of multipart/form-data, as required by this method

Custom View

You can create a new page or view within PC3 with your own custom content. Customize top navigation tabs by modifying the $rootScope.topNavTabs array using custom functions such as ngLoadInit. A special /custom route is defined which navigates to the CustomViewCtrl with a blank custom.html template. The HTML contents of the custom.html template are bound to a content variable in the $scope of that controller, which updates using a $scope.updateContent(html) function. This allows administrators to control the HTML content of that custom page with custom code in the ngLoadController function.

For example, if an administrator wants to add a tab named "Resources" to the top navigation bar and have that tab open a page in PC3 that displays the contents of a PageBuilder page named "pc3_resources", they could use code in their custom.js file such as the following example:

var ngLoadInit = function($rootScope) {
/* Add a "Resources" tab to the $rootScope.topNavTabs */
var resourcesTab = {
order: 3,
label: 'Resources',
href: $rootScope.baseUrl + '#/custom',
active: false,
activeTest: function() {
return location.hash.indexOf('#/custom') === 0;
}
};
$rootScope.topNavTabs.push(resourcesTab);
};
var ngLoadController = function($rootScope, $scope, controller) {
/* When the "Resources" tab loads, retrieve the PageBuilder page "pc3_resources" and display it as the contents of the customView */
if (controller == 'customView') {
var customContent = '';
var getPageContentPromise = $rootScope.services.LuminateRESTService.getPageContent('pc3_resources', true, '').then(function(response) {
if (response && response.data && response.data.pageContent) {
customContent = response.data.pageContent;
$scope.updateContent(customContent);
}
});
$rootScope.loadingPromises.push(getPageContentPromise);
}
};

To use custom code to access a reusable PageBuilder page on the site using the getPageContent function, configure the site to allow PC3 to access reusable PageBuilder pages, as described next.

Access Reusable PageBuilder Pages

To use getPageContent to retrieve the contents of reusable PageBuilder pages, create a PageBuilder page named "getPageBuilderPageContent" as a secure page, then use the plain text editor (not WYSIWYG) to add the following content:

[[?xx::x[[S334:callback]]x::[[U8:application/json]]::[[U8:application/javascript]][[S334:callback]](]]
[[?xx::x[[S334:pb_page_name]]x::
{
"error": {
"code": "2",
"message": "Please specify a value for 'pb_page_name'."
}
}
::
{
"pageContent": "[[E130:[[T8:[[T6:[[E51:[[S334:pb_page_name]]]]]]]] "\'" "'" replaceall]]"
}
]]
[[?xx::x[[S334:callback]]x::::)]]

This creates a pseudo-API for retrieving reusable PageBuilder pages.

Note: Do not use the WYSIWYG editor to edit the "getPageBuilderPageContent" page. The WYSIWYG editor adds additional HTML code that prevents this functionality from working properly.