We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43454
    • 14 Posts
    Hi!
    Maybe i'm wrong, but why is "getPage" doesn't react on pageLimit-parameter. Why it doesn't hide control buttons (like prev/next, last/first).

    So we need to add another check in file "core/components/getpage/include.getpage.php", in string 14 and 28
    --- if ($i == 1 && $i != $page && !empty($pageFirstTpl)) {
    +++ if ($i == 1 && $i != $page && !empty($pageFirstTpl) && ($page - 1) > $pageLimit) {
    

    --- if ($i == $pageCount && $i != $page && !empty($pageLastTpl)) {
    +++ if ($i == $pageCount && $i != $page && !empty($pageLastTpl) && ($pageCount - $page) > $pageLimit) {
    


    MODx ver. "MODX Revolution 2.2.13-pl (traditional)".
    Plugin ver. "1.2.4".
      • 30585
      • 833 Posts
      Can you post your getPage call?
        A MODx Fanatic
        • 43454
        • 14 Posts
        Quote from: treigh at Apr 18, 2014, 07:13 AM
        Can you post your getPage call?
        Сall -
        [[!getPage@artpolitics?
                                            &element=`getResources`
                                            &tpl=`newsTpl`
                                            &sortby=`id`
                                            &dir=`DESC`
                                            &includeContent=`1`
                                            &includeTVs=`1`
                                            &where=`[{"publishedon:>=":"[[!getDate? &offset=`2014-04-16`]]", "publishedon:<":"[[!getDate? &offset=`2014-04-19`]]"}]`
        ]]
        


        Snippet's properties -
        cache 
        No
        	
        cache_expires	
        false
        	
        cache_handler	
        false
        	
        cache_key	
        false
         
        	
        elementClass	
        modSnippet
         
        	
        limit	
        5
         
        	
        namespace
         
         
        	
        offset	
        0
         
        	
        page	
        0
         
        	
        pageActiveTpl	
        <li[[+activeClasses]]><a[[+activeClasses:default=` class="active"`]][[+title]] href="[[+href]]">[[+pageNo]]</a></li>
         
        	
        pageFirstTpl
        <li[[+classes]]><a[[+classes]][[+title]] href="[[+href]]">[[+pageNo]]</a></li><li><span>...</span></li>
         
        	
        pageLastTpl	
        <li><span>...</span></li><li class="control"><a[[+classes]][[+title]] href="[[+href]]">[[+pageNo]]</a></li>
         
        	
        pageLimit	
        5
         
        	
        pageNavOuterTpl	
        [[+first]][[+pages]][[+last]]
         
        	
        pageNavScheme 
         
        	
        pageNavTpl	
        <li[[+classes]]><a[[+classes]][[+title]] href="[[+href]]">[[+pageNo]]</a></li>
         
        	
        pageNavVar	
        page.nav
         
        	
        pageNextTpl	
        <li class="control"><a[[+classes]][[+title]] href="[[+href]]">>></a></li>
         
        	
        pagePrevTpl	
        <li class="control"><a[[+classes]][[+title]] href="[[+href]]"><<</a></li>
         
        	
        pageVarKey	
        page
         
        	
        totalVar
        
        	
        total
        
          • 30585
          • 833 Posts
          Just for testing purposes before we dive any deeper, what do you get when you omit &where property? Is the limit respected?

          Can you also post your getDate snippet here?
            A MODx Fanatic
            • 43454
            • 14 Posts
            Quote from: treigh at Apr 18, 2014, 10:08 AM
            Just for testing purposes before we dive any deeper, what do you get when you omit &where property?
            It is all the same.
            Quote from: treigh at Apr 18, 2014, 10:08 AM
            Is the limit respected?
            Yup, don't see any bad about it.
            Quote from: treigh at Apr 18, 2014, 10:08 AM
            Can you also post your getDate snippet here?
            It is just "strtotime()" snippet.

            There is no difference with/without &where parameter