pagination?
-
Hi! This plugin is wonderful, thank you.
Can you implement pagination on the feed so that the number of animals to show is “per page”?
Thanks so much!!
https://www.ads-software.com/extend/plugins/petfinder-listings/
-
Hi,
Unfortunately, I have to filter results like animal, breed and contact on the data from Petfinder myself because Petfinder does not provide these filters on their shelter.getPets API call. They do on their pet.find call but that call doesn’t limit results to a single shelter which is the main point of my plugin. Because I filter the results returned from petfinder, I don’t know how many animals will be displayed on the page until after I have the data from Petfinder so paging would not be very useful.
I suppose I could provide a separate call that paged but didn’t filter results. Would that be useful to you?
Bridget
Do you mean that it would call all the animals from petfinder and then creating paging? No that’s not usedful ??
I’m not a plugin developer so bare with me in case my next questions/ideas are stupid.
Can you query shelter.getPets and parse the XML to count the number of results and then create paging from that?
I would not be advese to a “loading” animation for a few second son page-load if it meant that I could create an easier experience for people browsing.
On that same note could you parse the XML for the individual pet options (no kids, large, baby, etc) and create your own filtering system after pulling in the data?
Finally – can you call the XML, then tell it to display the results in the opposite order so newest pets are shown first (I know that was mentioned in another thread)
Thanks so much for your help. If I could code the plugin rather than just imagine the UX I would totally help with this!!!
I could get all pets with your shelter and page those. This method would not allow filtering on animal, breed or contact, but the animals would all be in your shelter.
With the filters, I make the call for say 50 results then loop through and filter on animal, breed or contact. So if you ask for only dogs but have dogs and cats, I get 50 results of all from petfinder then filter out the cats. Which could have any number of results. With paging this would become very difficult. To use an extreme case – you might have only 10 dogs returned in the first 50 results but want to page in groups of 20. I would have to get more results to get up to 20 for one page and I’d have no idea how many pages of only dogs are available. The filtering would need to happen before I get the results for paging.
I just got a response from Petfinder. This is what they said about filtering:
“We are working on delivering a new API with many new features and functionality that doesn’t exist today. Pagination will be a significant enhancement to the existing API as well as making it easier to get the data you need in a useful way. Unfortunately, we are not adding features to the existing API but we value suggestions such as yours and are considering them as requirements for the next API.”
I’ll watch for the next Petfinder API and when it comes out integrate it into the Petfinder Listings plugin with any new features they add. I’ll reply to my contact that it would be great if they added sorting capability on pet name, and date added also.
Bridget
“I could get all pets with your shelter and page those. This method would not allow filtering on animal, breed or contact, but the animals would all be in your shelter.”
I think this would be a great option in the settings (with a note that states you can’t use shortcode filters with this activated)
We currently have 76 dogs on our page and importing the whole list on one page is a long scroll. Breaking it into 4 pages would be ideal.
Another quick question – can you query the shelter Id and import the listings into a database table, and then create a custom filter within the plugin that gives both the breed/keyword results as well as sorting options?
I will look into adding paging without filters when I have some time. It will probably be a new shortcode so people don’t get confused.
Importing data into a database would be a big ordeal. Petfinder has replied to my requests to add sorting and paging with filtering and said they have a new API with these added features coming out in a few months. I’m going to wait until that API comes out to make any huge modifications because the new API will make things much easier.
Bridget
Thanks again Bridget!
- The topic ‘pagination?’ is closed to new replies.