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

    I am a C#.Net developer, wanting to get into ModX so I can increase my skillset. I have done a fair amount of research on the topic, but ModX documentation seems a little ’minimal’ and tutorials very few.

    I may therefore be doing something foolish which is making my situation more complex than it should be.

    I am making a simple portfolio site. Under the main nav item "Design" (id 6) I want to show the first child of Design, and a paginated nav with "previous", "next" and "n of N" where n is the current page, and N is the total number of pages. I also want a subnav, listing all items under Design (id 6)

    I have achieved this so far by creating a "Design" page which uses FirstChildRedirect to redirect to the first child.

    I then use Wayfinder in the child pages in order to create the subnav. This is all working fairly well.

    I then wanted to add pagination. I have found that Ditto, which I used the last time I played with ModX, some 3 years ago, is no longer the flavour of the month, and that I should be using getResource and getPage. I have installed both.

    When I use the example given in the getPage page (http://rtfm.modx.com/display/ADDON/getPage) I then get a list of all the items, using a template. However, there is no pagination navigation. Surely I should get the default?

    [[!getPage? &element=`getResources` &parents=`6` &tpl=`myRowTpl`]]
    <div class="pageNav">[[!+page.nav]]</div>


    I have created chunks named "pagePrev" and "pageNext" which are a copy/paste from the default pagePrevTpl and pageNextTpl code, without the wrapping <li> tags.

    How do I tell the pagination nav to show? How do I use my chunks (rather than the default)?

    After reading on these forums about a similar problem I altered the "pageNav" div to read:
    [[+page]] of [[+pageCount]] | [[!+page.nav]]


    However, this shows text saying

    1 of 1 |

    This is incorrect in that there are more than 1 pages; and, the page.nav is not displayed.

    Also, seeing as apparently getResources spits out a list of all the pages, is there any reason to use Wayfinder for the subnav? It seems that the list of child pages can be generated by getResources.

    What I would really value would be a more complete tutorial/example than the limited help in RTFM - if anyone has a link to one, please let me know. If not - please suggest what I might be doing wrong.

    Thanks








      • 26466
      • 10 Posts
      Nothing?

      These forums are a bit of a disappointment. Surely there is a FAQ or a tutorial out there somewhere?

      Edit - in the end I hacked it from PrevJumpNext, but it is not ideal.
        • 34108
        • 66 Posts
        Hi scudsucker smiley The forums can be a bit hit and miss sometimes but for the most part are pretty good, I’m surprised someone hasn’t replied to your question yet, I’m not sure if my answer is exactly what you’re after but it may help.

        Myself and a few other posters were having a similar problem which I’ve just found a basic solution to, the thread is here - http://modxcms.com/forums/index.php/topic,61108.msg357572.html#msg357572

        Documentation for Revo is indeed a bit light on the ground which is a shame but I know it’s something the modx team are working hard on rectifying, they want modx to be known as an open-source CMS with good doco and I agree it needs it. In the meantime I find these forums helpful, the modx addons page you linked to, and Bob’s Guides - http://bobsguides.com/modx-revolution.html

        I hope that helps.
          • 13978
          • 2 Posts
          Hi There,

          i´m not shure if your still looking for a solution but i had the same Problem with a simple Prev Next Navigation in Modx Revoluition.

          There actually is a snippet called selflink from bertoost which satisfies all the needs for a prev next navigation.

          You can find the actual snippet here: http://modx.com/extras/package/selflink

          Just read trough the selfexplaining snippet and your done,..

          Awesome! smiley





            • 34108
            • 66 Posts
            Neat smiley Thanks jepedia, that will come in handy for sure!
              • 19873
              • 67 Posts
                • 3749
                • 24,544 Posts
                For getPage, you need to create a Property Set containing the names of your alternate Tpl chunks as properties so getPage knows to use them.


                http://rtfm.modx.com/display/ADDON/getPage#getPage-PageNavigationTemplateProperties
                  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