Forums Forums Search & Filter Pro Paged detection in php when using Ajax?

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #219085

    Hello,

    I have created a custom template for the results and are having trouble with one part. On the first/initial page of results (displaying all) the first 3 posts are formatted differently than the rest of the posts. That’s easy enough to do in my template file. However, on the second page of results I don’t want the first 3 formatted differently. If I wasn’t using Ajax I know I could use !is_paged() to find out if I’m on the first/initial page of results. But that is not working…I’m guessing because the form is using ajax to load the results results.

    Does anyone know of a way in PHP that I can detect whether or not I’m on the first page of results when being loaded using Ajax?

    Trevor
    #219101

    Does the URL have sf_paged in it?

    Anonymous
    #219138

    Hi Trevor,

    Yes the url does have sf_paged in it. Should is_paged() be working?

    Anonymous
    #219142

    Ok I think I might have figured it out. I tried using:
    !isset($_GET['sf_paged']) and it appears to be working!!!

    If this is not the correct way to do so please let me know.

    Thanks

    Trevor
    #219146

    That was what I was going to suggest. I will close this thread for now.

Viewing 5 posts - 1 through 5 (of 5 total)