• Resolved ximkronos

    (@ximkronos)


    Hello,

    A simple feature : be able to use a custom template for infinite scroll

    If you chose the mode “Use my own theme search template”, you can do whatever you want already.

    I saw this on the other topic but I have a problem with the infinite scroll. I searched a lot to customize the displayed content that the ajax request get, but i don’t know how to do it.

    For me, the reply of the ajax call is made in the ajax_solr_services.php/return_solr_results() function, whitch itself call the WPSolrSearchSolrClient::display_results method that build the response. But never call an external template or something like this.
    So, in my search page, i have the content display the way I like and when i come to the bottom of the page, the other results of the search displayed as default by those functions.
    Am I missing something here?

    https://www.ads-software.com/plugins/wpsolr-search-engine/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author WPSolr free

    (@wpsolr)

    If you chose the mode “Use my own theme search template”, you can do whatever you want already.

    In this mode, the wpsolr ajax template is not used. It is your theme’s search template which is used: you can then do really what you want.

    Thread Starter ximkronos

    (@ximkronos)

    What template are you talking about?
    I already use this mode, but it’s not working. It d’ont use my temlate for the items loaded in ajax.

    Plugin Author WPSolr free

    (@wpsolr)

    With this mode, the standard WordPress search is replaced (urls containing ?s=), but not your theme’s search UI.

    Thread Starter ximkronos

    (@ximkronos)

    That’s why i use a search.php template that customize the display, but not for the ajax items.

    Plugin Author WPSolr free

    (@wpsolr)

    There a plenty of WP themes that uses infinite scrolls. Use them.

    Thread Starter ximkronos

    (@ximkronos)

    Can you give me more exlaination about how to customize those ajax items for the infinite scroll?

    I didn’t succeed do find a theme working with infinite scrolls and don’t use the default display.

    And I’m always keeping in mind :

    For me, the reply of the ajax call is made in the ajax_solr_services.php/return_solr_results() function, whitch itself call the WPSolrSearchSolrClient::display_results method that build the response. But never call an external template or something like this.

    There must be something i don’t know/understand.

    Plugin Author WPSolr free

    (@wpsolr)

    That’s why i use a search.php template that customize the display, but not for the ajax items.

    If you do so, with the “Use my own theme search template” option, there is no more Ajax items. It’s a standard WP search loop, that you manage as you want.

    Thread Starter ximkronos

    (@ximkronos)

    with the “Use my own theme search template” option, there is no more Ajax items

    So if understand well. I have a choice to make :
    I can use infinite scroll with your default templates.
    Or i can define my own templates to display what i want. But in that case there is no way to use the infinite scroll properly.
    But you say this earlier :

    A simple feature : be able to use a custom template for infinite scroll

    If you chose the mode “Use my own theme search template”, you can do whatever you want already.

    But it just seem to be false.

    From the code it doesn’t seems possible to customize the output of infinite scroll (from ajax requests) and all your answsers are confusing (“yes it’s possible” but “no more ajax if use your own theme”).

    Plugin Author WPSolr free

    (@wpsolr)

    The confusion comes from the mix of Ajax and infinite scroll concepts in the same thread.

    1) I agree, the Ajax does not use templates, that you could override.

    2) If you want a good entry point to infinite scroll, read js/jquery.infinitescroll.js
    With it you can build your own search.php infinite scroll, with the current wpsolr ajax look&feel

    3) I you want to change the Ajax look&feel, you’ll have to rewrite your own return_solr_results() function and display_results() method

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom display for infinite scroll’ is closed to new replies.