We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Pro Search Pagination Search Result Display

How Do I?

James White's avatar
James White
6 posts
2 years ago
James White's avatar James White

Hi,

I’m having issues using EE’s Pro Search, and I am trying to display the results for the same data using two separate {exp:pro_search:results} loops for different areas of the page.

The loops should return the same results when clicking the pagination, but the first results relating to the first page still remain. It should really display the next ones within the sequence. Does Pro Search have a way of displaying the same results when you cycle through the pagination for two loops? Or is there a conditional or parameter that can help match the results on each paginated page?

Thanks, James

       
Russ K.'s avatar
Russ K.
174 posts
2 years ago
Russ K.'s avatar Russ K.

Not sure if I can help, but what does your search results tag look like? By default… the display that you expect is what you should get. If you have it limited to 10 per page, then page 1 should be 1-10, page 2 11-20, etc.

R

       
James White's avatar
James White
6 posts
2 years ago
James White's avatar James White

Hi Russ,

Thanks for the reply.

Here are the code examples for both loops below. Everything works OK when you’re on the first results page. When you cycle through the pagination pages, Loop 2 displays the first 10 from the first results page, not the results that are later in the sequence.

Loop #1 – displays the results in a list form

{exp:pro_search:results
  limit="10"
  channel="properties"
  orderby="date"
  query="{segment_3}"
}

Loop #2 – displays the results in map markers for Google Maps

const locations = [
        // match map markers with list view entry display
        {exp:low_search:results
          query="{segment_3}"
          limit="10"
          channel="properties"
          require_all="category"
        }  
          [{
{property_location}lat: {property_location:latitude}, lng: {property_location:longitude} {/property_location}},
"{property_address}{property_address:address_1}{/property_address} {property_city}"
],
        {/exp:low_search:results}  
      ];

James

       
Russ K.'s avatar
Russ K.
174 posts
2 years ago
Russ K.'s avatar Russ K.

I would try changing your “Low_search” tags in the second loop to “pro_search” first….

Also, is the “const locations [] ” a javascript Array? that may be interferring….

       
Russ K.'s avatar
Russ K.
174 posts
2 years ago
Russ K.'s avatar Russ K.

Also, just noticed… see if removing the “require_all” parameter helps as well. From the Docs: “require_all Set to one or more parameter names to have their values treated as an inclusive stack.”

       
James White's avatar
James White
6 posts
2 years ago
James White's avatar James White

The const locations = [] is the JS array based on the Google Maps Platform to display the object data for each entry or location.

The require_all = attribute has been removed from Loop 2 and have taken it out of the locations array, but it still does the same thing on returning the first 10.

Do you reckon it might be to do with the pagination from Loop 1 not matching with Loop 2?

       
Russ K.'s avatar
Russ K.
174 posts
2 years ago
Russ K.'s avatar Russ K.

Possibly… I’m not sure… Did you change the low_search tags to pro_search? I know those are supposed to be aliased in the codebase but when things don’t work as I expect I start by just trying to bring stuff like that into line.

Have you looked at an addon for the Map like Reinos Maps? that is supposed to be good (I haven’t used it) and it Might address the issue you are having…

       
James White's avatar
James White
6 posts
2 years ago
James White's avatar James White

Hi Russ,

The markup tags have been updated to pro_search but the issue still remains with the pagination results not updating the locations array. I’ll have a look at Reinos Maps to see if it can address the issue.

Thanks for the suggestions and advice on this.

Regards, James

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.