List team members on CMS page

Options

I'm trying to display a list of all team members for a specific team on a CMS page.  The closest I've been able to come was using the S36 tag with the "top_participants_list" type, but this leaves out team members with no donations.  (I also don't want to include amount raised, anyway.)

 

Is there some sort of "all_participants_list" type that would achieve this, or a different S-Tag I could use?  The S-Tag master reference PDF doesn't seem to mention it.

 

Thanks!

Tagged:

Comments

  • There's always the CRTeamraiserAPI.getTeamMembers method.

  • Brian Mucha:

    There's always the CRTeamraiserAPI.getTeamMembers method.

    If you're using jquery, here's a start. This is not tested. (All I did was make a few changes to my ParticipantRoster jquery plugin.  http://community.convio.com/t5/APIs/jquery-getParticipantRoster-js/td-p/21004 )

     

     


    /*
    * jQuery plugins for Convio TeamRaiser[TM]
    * Version 1.0 (06/06/2012)
    * @author Brian P. Mucha (bmucha@childrensmemorial.org)
    */

    /*
    * The getTeamRoster() method provides a simple way of showing a list
    * of TeamRaiser participants with links to their personal fundraising pages.
    *
    * getTeamRoster() takes the following arguments:
    *
    * proxyURL (required)
    * nonsecureConvioPath (required)
    * secureConvioPath (required)
    * apiKey (required)
    * fr_id (required)
    * team_id (required)
    * loadingImage (optional)
    * loadingText (optional)
    * personalPageDelimiter (optional)
    *
    * Example:
    *
    * <script type="text/javascript">
    *
    * $(document).ready(function() {
    * $('#rosterList').getTeamRoster({
    * 'proxyURL':'AjaxProxy?auth=[[S86:true]]&cnv_url=',
    * 'nonsecureConvioPath':'http://[[S29:smileyvery-happy:OMAIN]][[S29:smileytongue:ATH]]',
    * 'secureConvioPath':'https://'+'[[S29:smileyfrustrated:ECURE_DOMAIN]][[S29:smileyfrustrated:ECURE_PATH]]',
    * 'apiKey':'[[S0:CONVIO_API_KEY]]',
    * 'fr_id':'[[S334:fr_id]]',
    * 'team_id':'1234',
    * 'loadingText': 'Loading...',
    * 'personalPageDelimiter': ' - '
    * })
    * });
    * </script>
    */

    (function( $ ){

    var methods =
    {
    init : function( options )
    {
    settings = $.extend( {}, defaults, options );
    markLoading( this, settings );
    updateElement( this, settings );
    }
    };

    var defaults =
    {
    'proxyURL' : null,
    'nonsecureConvioPath' : null,
    'secureConvioPath' : null,
    'apiKey' : null,
    'fr_id' : null,
    'team_id' : null,
    'loadingImage' : null,
    'loadingText' : null,
    'personalPageDelimiter' : ', '
    };

    // Public Functions

    $.fn.getTeamRoster = function( method )
    {
    if ( methods[method] ) {
    return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
    return methods.init.apply( this, arguments );
    } else {
    $.error( 'Method ' + method + ' does not exist on jQuery.getTeamRoster' );
    }
    };

    // Private Functions

    function markLoading( element, settings )
    {
    $('.rosterentry').remove();
    if(settings.loadingImage&&settings.loadingText)
    element.append('<p id="rosterloading""><img alt="' + settings.loadingText + '" src="' + settings.loadingImage + '" />' + settings.loadingText + '</p>');
    else if(settings.loadingImage)
    element.append('<p id="rosterloading"><img alt="' + settings.loadingText + '" src="' + settings.loadingImage + '" /></p>');
    else if(settings.loadingText)
    element.append('<p id="rosterloading">' + settings.loadingText + '</p>');
    }

    function updateElement( element, settings )
    {
    var dataString =
    'method=getTeamMembers' +
    '&v=1.0' +
    '&api_key=' + settings.apiKey +
    '&response_format=json' +
    '&suppress_response_codes=true' +
    '&fr_id=' + settings.fr_id +
    '&team_id=' + settings.team_id;

    var requestURL = settings.proxyURL + escape(settings.secureConvioPath + 'CRTeamraiserAPI?' + dataString);

    $.getJSON(requestURL, function(data)
    {
    if( data.errorResponse )
    {
    element.html("<p>(" + data.errorResponse.message + ")</p>");
    } else {
    $('#rosterloading').remove();
    var trObject=data.getParticipantsResponse.participant;
    if ($(trObject).size()==1)
    {
    // TODO: trObject is a participant, not a collection.
    } else if ($(trObject).size()>1) {
    $.each(trObject,function()
    {
    var newEntry = $('<p />').attr('class', 'rosterentry' );
    newEntry.append(this.name.first + " " + this.name.last);
    newEntry.append(settings.personalPageDelimiter);
    newEntry.append("<a href=\\"" + this.personalPageUrl + "\\">Personal Page</a>");
    element.append(newEntry);
    });
    } else {
    var newEntry = $('<p />').attr('class', 'rosterentry' );
    newEntry.append('(end of list)');
    element.append(newEntry);
    }
    }
    });
    };

    })( jQuery );

     

Categories