We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16899
    • 284 Posts
    Hi All

    I´m having a little problem with getpage output.
    My situation is:
    1- I´ve got a page which is content for 7 results;
    2- I want to show 5 results per page. So i´ll have two pages, First page with 5 results and the second page with 2 results.

    The problem is, when i click in the getpage pagination for page two or last page, won’t show me the last two results!!!! What i´m doing wrong?

    You can view the situation here - http://www.jf-carvoeiro.pt/noticias-e-eventos/

    The code that i´m using is -
    			<!-- Start Ultimas Noticias -->
    			<div id="ultimas-noticias">
    					
    					[[!getArchives?
    					&parents=`41`
    					&toPlaceholder=`news-all`
    					&tpl=`latest-news`
    					&tplLast=`latest-news-last`
    					&includeTVs=`1` 
    					&processTVs=`1`
    					]]
    					
    					[[+news-all]]
    					
    					[[!getPage? &element=`getResources` &parents=`[[*id]]` &tpl=`myRowTpl` &limit=`3` &offset=`1` ]]
    					<div class="pageNav">[[!+page.nav]]</div>
    					
    			</div>
    			<!-- End Ultimas Noticias -->
    



    Many thanks in advance
      • 22019
      • 390 Posts
      In your getPage call : remove &offset=`1` and change &limit to =`5`. Add &pageVarKey=`page`.

        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 3109 ☆ A M B ☆
        • 894 Posts
        This code you have here is what you are using for the homepage where it’s displaying only 3 articles so in theory it is working like it should on that page, although I don’t see the page navigation on it.

        Try changing the limit to 5 so that it displays only 5 articles per page and the offset to 0 unless there’s a specific reason for it being 1.

        I also noticed that when you click on page 2 it just displays the same content, so make sure you have more than 5 entries.

        Si es mas facil explicar en español lo que quieres hacer dejame saber a ver como te puedo ayudar wink
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 16899
          • 284 Posts
          Yo, yo soy portugues, puedes hablar en espanol, yo compreendo!!!!! smiley

          i´ve got this in my code but still no working... >:(

          			<!-- Start Ultimas Noticias -->
          			<div id="ultimas-noticias">
          					
          					[[!getArchives?
          					&parents=`41`
          					&toPlaceholder=`news-all`
          					&tpl=`latest-news`
          					&tplLast=`latest-news-last`
          					&includeTVs=`1` 
          					&processTVs=`1`
          					]]
          					
          					[[+news-all]]
          					
          					[[!getPage? &element=`getResources` &parents=`41` &tpl=`myRowTpl` &limit=`5` &pageVarKey=`page` ]]
          					<div class="pageNav">[[!+page.nav]]</div>
          					
          			</div>
          			<!-- End Ultimas Noticias -->
          
            • 16899
            • 284 Posts
            Quote from: benmarte at Dec 16, 2010, 07:44 AM

            This code you have here is what you are using for the homepage where it’s displaying only 3 articles so in theory it is working like it should on that page, although I don’t see the page navigation on it.

            Try changing the limit to 5 so that it displays only 5 articles per page and the offset to 0 unless there’s a specific reason for it being 1.

            I also noticed that when you click on page 2 it just displays the same content, so make sure you have more than 5 entries.

            Si es mas facil explicar en español lo que quieres hacer dejame saber a ver como te puedo ayudar wink

            Quiero que mi página de noticias del 5 por página, pero no funciona !!!!! ¿Tiene usted alguna idea de cómo puedo utilizar una plantilla para la paginación?
              • 22019
              • 390 Posts
              You need to repeat the styling / placing instruction you’ve given at the top of the page to produce the archive, in the getPage call. Add
              &toPlaceholder=`news-all` &tpl=`latest-news` &tplLast=`latest-news-last` to your getPage call (remove the &tpl=`myRowTpl`).

              That way getPage should put something in the news-all placeholder instead of simply paginating (which it is doing correctly - page 1 and page 2 exist).
                Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                • 16899
                • 284 Posts
                Hi

                I´m not sure what´s happening but getPage it´s ignoring my second page... just show first page(the first five results!!!!! Well i´m also using archivist plugin, could this make some conflit?

                I´ve this full code...

                        <!-- Start Left Column -->
                        <div class="grid-8">
                 
                			<!-- Start Ultimas Noticias -->
                			<div id="ultimas-noticias">
                					
                					[[!getArchives?
                					&parents=`41`
                					&toPlaceholder=`news-all`
                					&tpl=`latest-news`
                					&tplLast=`latest-news-last`
                					&includeTVs=`1` 
                					&processTVs=`1`
                					]]
                					
                					[[+news-all]]
                					
                					[[!getPage? &element=`getResources` 
                					&parents=`41` 
                					&toPlaceholder=`news-all` 
                					&tpl=`latest-news` 
                					&tplLast=`latest-news-last` 
                					&limit=`5` 
                					&pageVarKey=`page` 
                					&totalVar=`total` 
                					]]
                					
                					<div class="pageNav">[[!+page.nav]]</div>
                					
                			</div>
                			<!-- End Ultimas Noticias -->
                 
                        </div>
                        <!-- End Left Column -->
                        
                        <!-- Start Right Column -->
                        <div class="grid-4">
                
                			<h2>Arquivos de [[+arc_year]]</h2>
                			
                			<ul> 
                				[[!Archivist? &parents=`41` &target=`41` &tpl=`testee` &useMonth=`0`]]
                			</ul>
                 
                        </div>
                        <!-- End Right Column -->
                
                  • 22019
                  • 390 Posts
                  Prueba con cambiar el orden de getArchives y getPage - creo que no puede saltar arriba en la pagina. De todos modos estara publicando el getArchives primero, o sea que no me extrana que siga siendo los mismos resultados.
                    Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                    • 16899
                    • 284 Posts
                    Quote from: odeclas at Dec 16, 2010, 10:27 AM

                    Prueba con cambiar el orden de getArchives y getPage - creo que no puede saltar arriba en la pagina. De todos modos estara publicando el getArchives primero, o sea que no me extrana que siga siendo los mismos resultados.

                    Mi hermano! Me cambié el orden de los fragmentos y getPage getArchives y de trabajo es !!!!!!!!!! Pero también había que añadir en includeTVs getPage & = "1" & = «1» processTVs! ¡Gracias! Yeahhhhhhh!
                    Descupa mi Google Translation Spanish!!!!! heheheheheheheheheh

                    			<!-- Start Ultimas Noticias -->
                    			<div id="ultimas-noticias">
                    					
                    					[[!getPage? &element=`getResources` 
                    					&parents=`41` 
                    					&toPlaceholder=`news-all` 
                    					&tpl=`latest-news` 
                    					&tplLast=`latest-news-last` 
                    					&limit=`5` 
                    					&pageVarKey=`page` 
                    					&totalVar=`total` 
                    					&includeTVs=`1` 
                    					&processTVs=`1`
                    					]]
                    
                    					[[+news-all]]
                    					<div class="pageNav">[[!+page.nav]]</div>
                    
                    					[[!getArchives?
                    					&parents=`41`
                    					&toPlaceholder=`news-all`
                    					&tpl=`latest-news`
                    					&tplLast=`latest-news-last`
                    					&includeTVs=`1` 
                    					&processTVs=`1`
                    					]]
                    					
                    
                    			</div>
                    			<!-- End Ultimas Noticias -->