-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Organisation-wide fundraiser-leaders? #16
Comments
@parkersweb as the plugin currently stands, no. However the API does allow you to pull all of an organization's fundraisers. I believe you could write a shortcode that would pull the following (as a starting point).
so the request params would look like:
Does that sound like it would achieve your goal? |
@dpfavand that sounds perfect - I'm guessing it'll take some digging through the current shortcodes to work out how to build on the API from the plugin to do that - unless there's some documentation available somewhere? |
@parkersweb it shouldn't be too difficult from the API perspective. There is documentation at https://developers.classy.org/api-docs/v2/index.html but I think the filter param above should work, provided the variable TWELVE_MONTHS_AGO is defined properly as an ISO date string without milliseconds. (Classy's API breaks if you supply ISO 8601-compliant milliseconds.) However, the ClassyContent class would probably have to be reworked to provide caching for these options to ensure that multiple uses of the shortcode with different parameters don't clash. @mjalkio and @cj-beck would adding this shortcode be acceptable for the plugin? I suspect we don't want a shortcode for every possible use case, but showing top organization fundraisers seems like a fairly general need and we can provide reasonable options for configuration. I'd suggest a shortcode with these options to meet @parkersweb's needs:
Perhaps the options should also be added to the campaign fundraisers and teams leaderboards? Again if we do this the caching mechanisms would have to be reworked. |
Unfortunately, the issue you're referring to with filtering on Everything else seems very reasonable. I don't see the need to update the caching mechanism (although it's all on the WP side, so it's doable). It's caching whatever resource you ask for, regardless of the options you provide. Unless you have a use-case where the same resource would be requested with different settings in a single use of the plugin, the current caching should still be fine. |
Ah good point re @mjalkio for caching, I'm thinking of exactly those use cases - for instance if your home page shows the top five fundraisers this year but on an inside page you show the top 50 fundraisers of all time. If the cache key is simply the org or campaign ID, they will conflict. Maybe the cache key could just be built out of the supplied shortcode/widget options? |
Hey guys,
On our public website we used to have a nice "top fundraisers" wall that showcased people from across all events & campaigns that were near to target and had raised over a nominal amount. That broke since API1 went away - so we're obviously looking to revive it in a shiny new API2 suit :)
Trouble is [classy-campaign-fundraiser-leaders id="12345" title="Top Fundraisers"] doesn't quite seem to fit the bill because I don't think we don't have a campaign id? Is that right?
Is there any way of achieving what we need?
Thanks!
Andrew
The text was updated successfully, but these errors were encountered: