We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14125
    • 62 Posts
    Can someone take a look at this? http://hewak.ca/breakawaydistributing.com/index.php?id=2&page=1

    I’m getting an array, but if you click on page 2 or 3, you just get the same content as page 1. It recognizes that there are 3 pages, but the pages with the overflowing content do not appear to exist, or at least they are not being called by the nav items that are generated. ANy ideas?

    Code:

    [[!getResources? &showHidden=`1` &tpl=`product1Tpl` &limit=`5` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &hideContainers=`6,7,8,9,10,11,13,16, 18,19,20,21,22,123, 24,25,27` ]]

    [[!getPage? &element=’getResources’ &parents=’[[*id]]’ &tpl=’paginationTpl ’]]
    [[+page]] of [[+pageCount]] | [[!+page.nav]]



      • 8609
      • 607 Posts
      getPage works by wrapping the getResource call, so you probably need to change your two calls to one call. Try replacing your current calls with just this one:


      [[!getPage? &element=’getResources’ &showHidden=`1` &tpl=`product1Tpl` &limit=`5` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &hideContainers=`6,7,8,9,10,11,13,16, 18,19,20,21,22,123, 24,25,27`]]
      [[+page]] of [[+pageCount]] | [[!+page.nav]]
        • 14125
        • 62 Posts
        Thank you. I understand what you mean but when i used it, the page content was gone so i guess the get resources call was not working. Also I’m not seeing a way to get getPage to output to a navigation chunk,ie, where does my paginationTpl go in the call? (the product1Tpl belongs to getResources)
          • 8609
          • 607 Posts
          Regarding the navigation output, you can set set this in a property set. According to the rtfm, "At this time, you can only override these template properties in a Property Set; if you use these inline in your getPage tag properties, you may get unexpected results because any placeholders in the inline content may potentially be processed before getPage and the element it is wrapping are processed." See http://rtfm.modx.com/display/ADDON/getPage

          For the getResources call not outputting anything, that’s rather interesting. Try adding &parent to your call. Also what’s in your product1Tpl chunk?

            • 35637
            • 9 Posts
            Hi, sorry about my english, but on my language nobody can help me.(( I’ve got a poblem with getPage when I’m using getResources twice at page. First for navigation:
            [[!getResources? &parents=`0` &tpl=`tplMenuRow` &depth=`0`]]

            and second time at news page
            [[getResources? &tpl=`tplNewsPreview` &parent=`2`]]

            i would like to devide list of news into pages:
            [[getPage? &elementClass=`modSnippet` &element=`getResources`]]

            So getPage doesn’t work propertly it shows a dump of arrays. How can I talk to getPage use limit and offset for @news@ getResources? Hope you will understand me:)
              • 29019 ☆ A M B ☆
              • 104 Posts
              You will need to set distinct values for &pageVarKey, &pageNavVar and &totalVar on each of your [[!getPage ... ]] calls, then make sure you use the correct ones for your placeholders. It should look something like this:

              [[!getPage? &element=`getResources` &pageVarKey=`firstPage` &totalVar=`firstPage.total` &pageNavVar=`firstPage.nav` ...]]
              <ul>
              	[[+firstPage.nav]]
              </ul>
              ...
              [[!getPage? &element=`getResources` &pageVarKey=`secondPage` &totalVar=`secondPage.total` &pageNavVar=`secondPage.nav` ...]]
              <ul>
              	[[+secondPage.nav]]
              </ul>
              
                www.darkstardesign.com

                Are you in the Nashville area? Join us for our next MODX meetup!
                • 35637
                • 9 Posts
                Swespi, thanks for answer! You didn’t understand me right. I’ve got only one [[!getPage]](for news ) and two [[getResources]](for navigation and news page). Look here http://www.vzhukov.hostkmv.ru/news/.
                  • 29019 ☆ A M B ☆
                  • 104 Posts
                  I see what you mean. Is your getPage call complete?

                  [[getPage? &elementClass=`modSnippet` &element=`getResources`]]


                  It looks like you’re missing a few arguments for getResources, which might be why you are getting the arrays. You should put all of your getResources parameters in your getPage call, like so:

                  [[!getPage? &elementClass=`modSnippet` &element=`getResources` &tpl=`tplNewsPreview` &parent=`2`]]


                  Also make sure you are using the uncached version of getPage.
                    www.darkstardesign.com

                    Are you in the Nashville area? Join us for our next MODX meetup!
                    • 35637
                    • 9 Posts
                    Unfortunately it doesn’t work.( instead of page navigation i recive list of news twice(( But dump of arrays disappear
                      • 29019 ☆ A M B ☆
                      • 104 Posts
                      The getPage snippet is a wrapper for getResources (or any element that lists things) so you can get rid of the extra getResources call. For the navigation try this:
                      <ul>[[+page.nav]]</ul>

                        www.darkstardesign.com

                        Are you in the Nashville area? Join us for our next MODX meetup!