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

    I would like to list a list of child pages with title and a small amount of content. Can someone provide me with where I can start on how to do this?

    Thanks
      • 10208 ☆ A M B ☆
      • 1,780 Posts
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 32347
        • 143 Posts
        MOdx Revo 2.5.1-pl

        Working on displaying multiple child resources on a container page. I have gotten this to work before, but I am not able to get it to work on this site. id:16 is the parent, then I have several child pages under it. So what I am looking to build is to have the title, and some of the content displayed with a more link. Probably will need some sort of paging.

        [[getResources?
        &parents=`16`
        &includeContent=`1`
        &limit=`1`
        &tpl=`resourceTpl`
        ]]

        resourceTpl has [[+content]]

        there are no errors. I have this site hosted with Known Host

        need help
          • 4172
          • 5,888 Posts
          your resources are published?

          maybe your resources are hidden from menu.
          Then you will need
          &showHidden=`1`


          and getResources is installed and working?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 32347
            • 143 Posts
            Quote from: Bruno17 at Sep 05, 2016, 01:00 AM
            your resources are published?

            maybe your resources are hidden from menu.
            Then you will need
            &showHidden=`1`


            and getResources is installed and working?

            Tired that but still can't get it to work. I even tried this [[getResources?
            &parents=`1`


            ]]
              • 32347
              • 143 Posts
              I finally got it working. I am not sure what I did as I was getting to the place of grasping at straws. I uninstalled the snippet and reinstalled it.

              This is the page info:

              [[!getResources?
              &tpl=`resourceTpl`
              &showHidden=`1`
              &limit=`10`
              &parents=`16`
              &sortby=`{"publishedon":"DESC"}`
              &includeContent=`1`

              ]]

              this si the tpl:
              <h3>[[+pagetitle]]</h3>
              <p>[[+introtext]]</p>
              [[+content]]

              it is unformated, but it works.

              When I added the showhidden and the includecontent it started working.
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                Quote from: wholein1 at Sep 05, 2016, 11:45 AM
                I finally got it working. I am not sure what I did as I was getting to the place of grasping at straws. I uninstalled the snippet and reinstalled it.

                This is the page info:

                [[!getResources?
                &tpl=`resourceTpl`
                &showHidden=`1`
                &limit=`10`
                &parents=`16`
                &sortby=`{"publishedon":"DESC"}`
                &includeContent=`1`

                ]]

                this si the tpl:
                <h3>[[+pagetitle]]</h3>
                <p>[[+introtext]]</p>
                [[+content]]

                it is unformated, but it works.

                When I added the showhidden and the includecontent it started working.

                That's how it works. Your resources are hidden from menus apparently. You'll have to take notice of that for future uses. Main menus often don't show all resources. To use the same snippet across the site you'll have to include &showHidden in all your menus.

                The alternate is to have resources set to show in menus and exclude them as needed. It depends on the site and how it's implemented and who it's edited by. If your client can remember to exclude documents, you can use ClientConfig https://www.modmore.com/extras/clientconfig/ to provide a placeholder to add new resource IDs as needed.
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster