Link Top Participants to Individual TeamRaiser pages from Wordpress Site
Hello,
looking for some assistance…I have a page set within a wordpress site that is pulling in the Top Participants. Of which, is working great! But now, I am looking to link each participant to their corresponding individual TeamRaiser pages. Here is the code I currently have set up…
<html>
<head></head>
<body>
<div id="top-fundraisers"> />
<script>
// Set up our HTTP request
var xhr = new XMLHttpRequest();
// Setup our listener to process completed requests
xhr.onload = function () {
// Process our return data
if (xhr.status >= 200 && xhr.status < 300) {
// What do when the request is successful
console.log('success!', xhr);
var container = document.getElementById("top-fundraisers");
var response = JSON.parse(xhr.responseText);
for (var count in response.getTopParticipantsDataResponse.teamraiserData) {
var participant = response.getTopParticipantsDataResponse.teamraiserData[count];
container.innerHTML += participant.name;
container.innerHTML += " - ";
container.innerHTML += participant.total;
container.innerHTML += "<br/>";
}
} else {
// What do when the request fails
console.log('The request failed!');
}
// Code that should run regardless of the request status
console.log('This always runs...');
};
// Create and send a request
var URL = "https://[CODE]/site/CRTeamraiserAPI?";
URL += "method=getTopParticipantsData";
URL += "&api_key=API KEY";
URL += "&v=1.0";
URL += "&response_format=json";
URL += "&fr_id=1740";
xhr.open('POST', URL);
xhr.send();
</script>
</body>
</html>
Assuming, the current method “TopParticipantsData” offers the requested ability.
Thank you in advanced!!
Comments
-
Hi, Michael!
The getTopParticipantsData call will get you what you need but you'll need to form the Personal Page link yourself. In your example the px or participant ID is going to be called with participant.id from the API call.
So in your loop, you'd need to create the anchor tag and for the HREF you would form:
https://YOURLUMINATESITEURL/TR?fr_id=1740&px="+participant.id+"&pg=personal
You're likely going to be better off creating actual containers (DIV, P or otherwise) with class names for each result. I think it would just save you a headache down the road versus depending on BR tags between each. Personal preference but certainly not required.
Hopefully this helps but let me know if I misunderstood the question.
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 359 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 563 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 243 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 779 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
