We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1061
    • 81 Posts
    How I can get a button like - all resources?
    Any ideas?
    Of course solution need with getPage.
      • 3749
      • 24,544 Posts
      What version of MODX?


      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 1061
        • 81 Posts
        Revo 2.2
          • 3749
          • 24,544 Posts
          I'm not clear on what you want, but it sounds like you want to call getResources with a getPage tag. If you specify the parent as 0, you should get all resources on the site. You might want to set a "where" clause with published set to 1 so you get only published resources.

          What do you want to display for each resource? If it's just the pagetitle, a custom snippet called in a getPage tag would be faster.


          ---------------------------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
          MODX info for everyone: http://bobsguides.com/modx.html
            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
            • 1061
            • 81 Posts
            I want to see in frontend/site next buttons
            |<< < 1 2 3 4 5 > >>| all

            all - means that the all elements of category will be displayed, in one page. [ed. note: alex_dutch last edited this post 14 years, 7 months ago.]
              • 3749
              • 24,544 Posts
              Resources don't have categories, so I don't think that's going to work. wink


              Whatever you do, I'd recommend getting it working with just getResources first and worry about pagination with getPage after you get it right.


              ---------------------------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
              MODX info for everyone: http://bobsguides.com/modx.html
                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
                • 1061
                • 81 Posts
                I mean that the "category" is container(folder of resources).
                I've try to explain more widely:
                Then you use paginate(use getPage) you have on page some(&limit) list of resources.
                Sometimes you need to see ALL resources instead of limit.
                I need some solution that show ALL resources in this page, that use a getPage.
                Like:
                first previous 1 2 3 4 5 next last all
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Just set the limit to something higher than the total. Allowing an unlimited limit might seem useful, but there should always be a limit when iterating through objects like this.
                    • 1061
                    • 81 Posts
                    Let's take some example.
                    I need on page(container have 100 childs) pagination(getPage), with 6 resources(docs) at once.
                    [[!getPage? &element=`getResources` &parents=`[[*id]]` &tpl=`myRowTpl` &limit=`6`]]
                    <div class="pageNav">[[!+page.nav]]</div>

                    on page I get some 6 docs and in foot I get something like this:
                    first previous 1 2 3 4 5 next last

                    Problem - I want a link(button) that shows all 100 resources at once.

                    How I can realise this link and of course I need getPage on this page?
                      • 1061
                      • 81 Posts
                      Awful way is create a resource that call all 100 resources.
                      This resource put in container and call him - ALL.

                      Add some changes:
                      <div class="pageNav">[[!+page.nav]] <a href="[[~id]]">ALL</a></div>