We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50923
    • 137 Posts
    I am strugling to convert my getResources to pdoResources

    Here is mine getResources call with getPage

    [[!getPage? &showHidden=`1` &elementClass=`modSnippet` &sortdir=`ASC` &element=`getResources` &cache=`false` &parents=`-1` &limit=`20` &resources=`2,5,6,7,8` &pageVarKey=`strana` &includeTVs=`1` &includeContent=`1`  &tvFilters=`Aktivna==1%` &tpl=`OffersList` &sortbyTV=`BrojZvezdica` &sortdirTV=`DESC` &pageFirstTpl=`<li class="control"><a[[+classes]][[+title]] href="[[+href]]">Prva</a></li>` &pageLastTpl=`<li class="control"><a[[+classes]][[+title]] href="[[+href]]">Poslednja</a></li>` &pageActiveTpl=`<li class="active"><a[[+classes]][[+title]] href="[[+href]]">[[+pageNo]]</a></li>`	]]


    Can somebody help me to convert to pdo?
      <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
      • 48146
      • 5 Posts
      Hi,

      You can find the official pdoTools documentation here: https://docs.modx.pro/en/components/pdotools/

      For your problem the following pagesc might be useful:

      pdoMenu: https://docs.modx.pro/components/pdotools/snippets/pdopage (Russian).

      If you don't speak Russian, you can try Google Translator https://translate.google.de/translate?hl=de&sl=ru&tl=en&u=https%3A%2F%2Fdocs.modx.pro%2Fcomponents%2Fpdotools%2Fsnippets%2Fpdopage:

      pdoResources: https://docs.modx.pro/en/components/pdotools/snippets/pdoresources (English)

      Also you should have a look at the general settings docs:
      Settings: https://docs.modx.pro/en/components/pdotools/general-settings (English)

      Many things true for getResources and getPage are still true for pdoTools. You can find the documentation for both snippets here:
      * https://rtfm.modx.com/extras/revo/getresources
      * https://rtfm.modx.com/extras/revo/getpage

      I'm a bit in a hurry, so I'm winging it for now. If something doesn't work right, let me know.

      [[!pdoPage@pdoPropertyName? 
          &showHidden=`1` 
          &elementClass=`modSnippet` 
          &sortdir=`ASC` 
          &element=`pdoResources` 
          &cache=`false` 
          &parents=`-1` 
          &limit=`20` 
          &resources=`2,5,6,7,8` 
          &pageVarKey=`strana` 
          &includeTVs=`1`      //doesn't work. You need to give a comma separated list instead: tv1,tv2,...,tvn
          &includeContent=`1`  
          &tvFilters=`Aktivna==1%` 
          &tpl=`OffersList` 
          &sortbyTV=`BrojZvezdica`  // I think you can use sortby instead
          &sortdirTV=`DESC`  // I think you can use sortdir instead
      ]]
      


      I don't use pdoPage that much, but from what I remember, you have to chanbge the pagination templates inside the pdoPage snippet property set (find the snippet under elements and have a look at the properties tab). Don't overwrite the original setting. Duplicate it and give it a meaningful name. Use the new property set by adding it to the pdoPage snippet name with an additional @ in between (for example: @pdoPropertyName, see above).

      I hope I haven't missed anything, but this should do the trick.

      Good luck!

      pepebe

      P.S. I haven't been here for ages. What happened with my posts counter? I should be around 300? [ed. note: pepebedesign last edited this post 10 years, 1 month ago.]
        • 4172
        • 5,888 Posts
        Here you go, Patrick:
        https://forums.modx.com/u/pepebe
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 48146
          • 5 Posts
          Quote from: Bruno17 at Aug 12, 2016, 11:53 AM
          Here you go, Patrick:
          https://forums.modx.com/u/pepebe

          Wrong account name? Well, this is embarrassing... wink

          Thanks!
            • 48146
            • 5 Posts
            I stand corrected. You can use tpl Chunks for pagination inside the pdoPage snippet call.

            This was not possible in getPage:

            You can NOT modify these tpl properties from the snippet tag directly, due to the order in which tags are parsed in Revolution.
            If you do want to change these defaults you will need to use a property set:

            Source: https://rtfm.modx.com/extras/revo/getpage

            I can still see the chunks in the pdoMenu snippet properties though... I guess bezumkin might be able to explain the pros and cons here.