We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16132
    • 9 Posts
    i begin to use this CMS i really like it.

    i will try to explain what i want to do.

    i want to do a homepage with automatic retrieving information for another documents in the site.
    think in three blocks with content. The upper block with the normal content of this document (document parent 0) the other two blocks with the summary or description of other documents.
    i think the structure can be done with tables or divs but how i can retrieve the information of another document o folder? there is some modx tag to do somethin like this? or may be a snippet?

    i will add a image example



      • 18397
      • 3,250 Posts
      One question as to the lower 2 blocks. Are they news items, random items, teasers, or something else?
        • 25663 MODX Staff
        • 12,272 Posts
        I think all docs will be just parts form other pages in the site. Enter @DOCUMENT and a few TVs I think.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 32241
          • 1,495 Posts
          In fact you can use Snippet to call the document by their id and return all the values in that doc (using getDocument API), and later you can use chunk to work as a template, so that you can customize it using placehlder and getChunk API.

          Hope that helps, it’s a little bit harder to approach, but it delivers more flexibility in my point of view.

          Hope that helps, and please choose the best and easiest solution for your needs, remember, the more you have flexibility in the system, the more you will use the system in effectively.

          Sincerely,
          Wendy Novianto
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 16132
            • 9 Posts
            thanks for the answer Wendy Novianto.
            getDocument API sounds really complex, I’m a graphic designer, i have some experience with cms but at the level of cut and paste and add tags (actually i can see some php code and know what is happening there) and i m new in MODx.

            So isn’t a simple way to call another document in other document? like: [[document ID 3 etc]]
            could be nice to do a home page with information of documents inside a site.
              • 16132
              • 9 Posts
              Answer to Mark:

              could be the descriptions or summary of another document inside the site (a document in modx tree)
                • 18397
                • 3,250 Posts
                Quote from: koffer at Dec 04, 2005, 11:10 AM

                So isn’t a simple way to call another document in other document? like: [[document ID 3 etc]]
                could be nice to do a home page with information of documents inside a site.

                Thats in the works for the new parser.

                In the meantime, you can use this simple snippet that I wrote:

                http://modxcms.com/forums/index.php/topic,1714
                  • 16132
                  • 9 Posts
                  I create a new snippet and put this code:

                  $id = isset($id)? $id: $modx->documentObject[’id’];
                  // paginatation enabled or disabled

                  $field = isset($field)? $field : "pagetitle";
                  // paginatation enabled or disabled

                  $result = $modx->getDocument($id,$field);

                  return $id;


                  Then i put [[getdoc? &id=6 &field=`pagetitle`]] in a document
                  and only display the number of the id, i try changing the field to another parameter (example: content) and still saw the number.
                    • 18397
                    • 3,250 Posts
                    Laughs! I copied and pasted the wrong code!

                    Go get the new code in the first post of that thread.
                      • 16132
                      • 9 Posts
                      Thanks, now is working

                      now i need to know how to apply a css style, i think via chunk (?)