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

    I just created my own template, I was really amazed by how easy it is to intergerate the script in a html site. This is really an awesome script. The problem is I’m trying to make it look like a blog, everything is done but I just can’t figure out how to have multiple documents on one page, maybe 10 documents/articles on one page. I’ve tried many things and searched (last post was in 2006 sad) but have had no luck. So how can I put multiple documents on one page?
      • 3707
      • 241 Posts
      Ditto is what you need. It’s comes installed with MODx and is used to aggregate documents. Using Ditto’s templating capabilities, you can format the output however you wish.
        • 29166
        • 9 Posts
        Can you walk me through? I’m trying to use ditto but can’t get it working. I added the [[Ditto]] in the file and added the chunks but it still says "No documents found." What do I do?
          • 34193
          • 330 Posts
            • 29166
            • 9 Posts
            I still see "No documents found." after adding this
            [[Ditto?&depth=`1` &display=`3` &orderBy=`id DESC` &tpl=`myDittoTemplate`]]


            Got a question, when I create a new document, do I put "Ditto" under "Link Attributes"? Basically how do I make documents go under Ditto?
              • 7231
              • 4,205 Posts
              You need to set the &parent=`??` parameter to tell ditto where to get the documents. The `??` should be replaced with the id of the parent document of the section you want to list with Ditto. The ID is the number in ( ) next to the document name in the document tree:

              -- Home (1)
              -- About (2)
              -- -- Sub-page (23)
              -- etc..
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 29166
                • 9 Posts
                I found
                &parents=`1`
                in the SHOW_BLOG chunk, changed the value but still says No documents found... sad
                Heres my template’s code, am I doing something wrong here?
                    	<div id="content2" class="style4">
                		<div class="post">
                [[Ditto?&depth=`1` &display=`3` &orderBy=`id DESC` &tpl=`myDittoTemplate`]]
                		</div>
                	</div>
                


                and my chunks are,
                BlogTemplate (3)
                CommentsBlog (2)
                INPUT_BLOG (5)
                myDittoTemplate (6)
                SHOW_BLOG (4)
                
                  • 7231
                  • 4,205 Posts
                  Are you following a tutorial or something? What is the SHOW_BLOG chunk? The code you need to edit is the one in the template making it:
                  <div id="content2" class="style4">
                  		<div class="post">
                  [[Ditto? &parents=`??` &depth=`1` &display=`3` &orderBy=`id DESC` &tpl=`myDittoTemplate`]]
                  		</div>
                  	</div>


                  Changing ?? to the correct id. This will output the news where the DItto call is located with the output template that is in the myDittoTemplate chunk.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 29166
                    • 9 Posts
                    Yeah I’m following a tutorial I came across on the modx site, well now it does show the name of the document but it doesn’t show any of the content. It just shows the name of the category and the summary but it doesn’t show any of the content. When I click on different posts it just takes me to the same page but the link changes (for example I click on Post 2, its the same as the page I was just viewing but link changes to index.php?id=16)
                      • 29166
                      • 9 Posts
                      Well I made another template, called it blog and set the post’s "Uses template" to blog, but now nothing shows up. Heres my blog code
                      <div id="content2" class="style4">
                      		<div class="post">
                      [[BlogTemplate]]
                      [[CommentsBlog]]
                      [[INPUT_BLOG]] 
                      		</div>
                      	</div>