We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    This is an auto-generated topic for getPage 1.0.0-rc1 by opengeek.

    Brief Description:

    A generic wrapper snippet for returning paged results and navigation from snippets that return limitable collections.

    getPage 1.0.0-rc1 (June 29, 2010)

    • Add per page caching capabilities
    • Add changelog, license, and readme
      • 3749
      • 24,544 Posts
      I’m using the examples for getpage and blogListPost from the docs as written (but with a different &parents). I also tried using my own Tpl chunk that works fine with getResources.

      I’m getting this output in either case:

      1. 15.
      16.
      
            17. 18. 
      
      19. 


      Is there something I need to set?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 22303 MODX Staff
        • 10,725 Posts
        Sorry BobRay; can you provide more information about what you mean? I’m not following.
          • 3749
          • 24,544 Posts
          I’m not sure what I can add. I installed getResources and getPage. I have a resource containing the following snippet tag, pasted directly from the docs except for the &parents parameter:

             1. [[!getPage?   
             2.    &elementClass=`modSnippet`  
             3.    &element=`getResources`  
             4.   
             5.    &parents=`93`  
             6.    &depth=`99`  
             7.    &limit=`10`  
             8.    &pageVarKey=`page`  
             9.   
            10.    &includeTVs=`1`  
            11.    &includeContent=`1`  
            12.   
            13.    &tpl=`blogListPost`  
            14. ]]  
            15. <div class="paging">  
            16. <ul class="pageList">  
            17.   [[!+page.nav]]  
            18. </ul>  
            19. </div>  


          This is the blogListPost chunk (also pasted from the docs):

            1. <div class="blogPost">  
             2.   <div class="date">[[+publishedon:strtotime:date=`%b %d %Y`]]</div>  
             3.   <h2><a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]]</a></h2>  
             4.   
             5.   <p class="author"><strong>Author:</strong> <span class="author">[[+createdby:userinfo=`username`]]</span></p>  
             6.   <p class="summary">[[+introtext]]</p>  
             7.   <p class="readmore"><a href="[[~[[+id]]]]"><span>Read more</span></a></p>  
             8.   
             9.   <div class="clear"></div>  
            10. </div>  
            11. <hr/>  


          When I preview the resource with the getPage tag, I get no output but what I show in the post above. No publication date, no pagetitle, not even "Read more" or the <hr>. Do I need to add a getResources tag on the same page? If so, what would it look like?



            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 22303 MODX Staff
            • 10,725 Posts
            I’m not sure what the problem could be BobRay; my tests are certainly working with it here as described in that documentation. Hmmm.
              • 3749
              • 24,544 Posts
              Hmm indeed. I’ll mess with it some more when I have time.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 25636
                • 21 Posts
                In my install of Revolution 2.0.0-pl rev7210, correctly rendered getPage paginated results disappear when I refresh the page. If I clear the site cache, they return - only to disappear again when I refresh the browser, or navigate away from the page and back again.

                This is possibly the same issue as http://modxcms.com/forums/index.php/topic,46346.msg273325.html#msg273325 (point number 2), except it’s my placeholder content (not the navigation) that is affected.

                Linux 2.6.32.8-grsec-2.1.14-modsign-2-opt2, PHP 5.2.13, MySQL 5.0.16 (client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.8

                The getPage call
                [[!getPage?
                  &element=`getResources`
                  &elementClass=`modSnippet`
                  &tpl=`newsItem` 
                  &tplOdd=`newsOddItem`
                  &pageVarKey=`page`
                  &parents=`[[*id]]`
                  &includeTVs=`1`
                  &processTVs=`1`
                  &toPlaceholder=`news`
                  &limit=`10`
                ]]
                
                [[!+page.nav:notempty=`
                <div class="paging">
                <ul class="pageList">
                  [[!+page.nav]]
                </ul>
                </div>
                `]]
                
                [[+news]]
                
                [[!+page.nav:notempty=`
                <div class="paging">
                <ul class="pageList">
                  [[!+page.nav]]
                </ul>
                </div>
                `]]


                tpl
                <div class="newsItem" id="news-item-[[+id]]">
                  <h3>[[+longtitle]]</h3>
                  
                  <div class="citation">
                    <ul>
                      <li>[[+tv.publishedon:strtotime:date=`%d %b %Y`]]</li>
                      <li>[[+tv.byline]]</li>
                      <li>[[+tv.externalURL:notempty=`<a href="[[*externalURL]]" rel="external">`]][[+tv.publisher:default=`Website`]][[+tv.externalURL:notempty=`</a>`]]</li>
                    </ul>
                  </div>
                    
                  <a href="[[~[[+id]]]]">[[+tv.thumbnail]]</a>
                  <p>[[+introtext]]</p>
                  <p class="clear"><a href="[[~[[+id]]]]">Read on »</a></p>
                <hr class="clear hide" />
                </div>


                I have getPage working correctly as an RSS feed for the site. How can I troubleshoot this issue?
                  Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
                  • 28215
                  • 4,149 Posts
                  Set &cache=`0` in your getPage call.
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 25636
                    • 21 Posts
                    Quote from: splittingred at Aug 10, 2010, 07:39 AM

                    Set &cache=`0` in your getPage call.
                    This resolved the issue. Thanks!
                      Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
                      • 22303 MODX Staff
                      • 10,725 Posts
                      FWIW, the issue here is that the per page caching feature will not work when using the toPlaceholder feature in getResources. If you want to take advantage of the per page caching, simply do not use the toPlaceholder property.