Subscribe: RSS
  • Revo 2.6.1
    pdoTools 2.11.0

    I'm in the process of moving from getResources and getPage to pdoTools.

    I have three unique getPage calls on one page, each one corresponds to a specific folder (category) of resources which it correctly displays. Everything works great with getPage. But after switching to pdoPage the pagination breaks.

    When a pagination link is clicked (e.g., 2, 3, Next etc.) the page reloads with the correct url (e.g., mysite.com/overview.html?page=2) in the browser address bar but the page (and url) that loads goes back to page one. It won't let me view any other page other than the first one.

    I use pdoPage with pagination successfully elsewhere on the same site so I know it works, just not on this particular page.

    After some poking around it seems the problem has to do with the multiple calls on one page. With only one pdoPage call on the page the pagination works exactly as expected, but as soon as I add more calls the pagination breaks again.

    As I said, it's been working fine with multiple getPage calls so I don't understand what's happening with pdoPage.

    Call One:
    [[!pdoPage@pdoPagination?
        &elementClass=`modSnippet`
        &element=`pdoResources`
        &parents=`2`
        &resources=`-1`
        &includeTVs=`1`
        &where=`{"createdby:=":[[!+modx.user.id]]}`
        &showHidden=`1`
        &sortby=`publishedon`
        &sortdir=`DESC`
        &tpl=`ArticleResult`
        &hideContainers=`1`
        &limit=`5`
        &pageLimit=`5`
        &toPlaceholder=`articleResult`
        &totalVar=`articlePublished`
        &pageNavVar=`page.nav.article`
        &showUnpublished=`1`
    ]]

    Call Two:
    [[!pdoPage@pdoPagination?
        &elementClass=`modSnippet`
        &element=`pdoResources`
        &parents=`3`
        &resources=`-1`
        &includeTVs=`1`
        &where=`{"createdby:=":[[!+modx.user.id]]}`
        &showHidden=`1`
        &sortby=`publishedon`
        &sortdir=`DESC`
        &tpl=`ReviewResult`
        &hideContainers=`1`
        &limit=`5`
        &pageLimit=`5`
        &toPlaceholder=`reviewResult`
        &totalVar=`reviewPublished`
        &pageNavVar=`page.nav.reviews`
        &showUnpublished=`1`
    ]]

    Call Three:
    [[!pdoPage@pdoPagination?
        &elementClass=`modSnippet`
        &element=`pdoResources`
        &parents=`4`
        &resources=`-1`
        &includeTVs=`1`
        &where=`{"createdby:=":[[!+modx.user.id]]}`
        &showHidden=`1`
        &sortby=`publishedon`
        &sortdir=`DESC`
        &tpl=`TutorialResult`
        &hideContainers=`1`
        &limit=`5`
        &pageLimit=`5`
        &toPlaceholder=`tutorialResult`
        &totalVar=`tutorialPublished`
        &pageNavVar=`page.nav.tutorials`
        &showUnpublished=`1`
    ]]

    This question has been answered by ferx77. See the first response.

      Todd
    • discuss.answer
        FerX - Developer at Eracom s.r.l.
      • @ferx77 Thank you very much!
          Todd