We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32519
    • 94 Posts
    Ok. I’m trying to make a template (or chunk) that looks like this page. http://www.themovietimeline.net/html/10_000_b_c_.html
    I have about 70 other pages that are going to be laid out in the same way. What is the best way to go about this?

    I know I want to utilize the ditto snippet, but I’m not sure how that will work? "ditto" can only call up documents that are on the site right? I mean, you can’t reference a external url and have it collect the title and information from that can you? I’m a bit confused. Do I just make a text document for every single movie page that I have, and then make "chunks" that have styling, formatting and a "ditto" to call up the information from the docs that I made? It’s not making sense to me! Don’t I have to put the chunks in the document content area? If so, where would the "ditto" get it from? It seems like I’ll be doing everything twice.
      <a href="http://www.themovietimeline.net">The Movie Timeline</a> | <a href="http://www.antstuff.net">The Antfarm Site</a>
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Each movie should have its own resource (document). Then on your main page where you want these to be displayed, use Ditto. The chunk acts as a mini-template for each item in the list. Ditto will loop through all the resources you tell it to (with the &parents parameter primarily) and apply that chunk tpl to each one, getting its data and replacing the placeholders in the chunk with the data. You can use all of the regular resource fields (pagetitle, longtitle, etc) plus TVs for extra stuff, like images.

      It doesn’t have to be a chunk; you can tell Ditto to use a file, or specify it in php code in an external config file. Ditto is very flexible.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org