We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18339
    • 14 Posts
    Mark Scudder Reply #1, 17 years ago
    First let me say that overall I love MODx. I use it because it stays out of my way and has the right balance of straightforwardness and power for rapid web design.

    That being said, I’m in a wild goose chase right now, and I can’t find a way out.

    I’ve been searching for days on how to resize image TVs. I have a section of a site where I need to attach an image to a bunch of documents. I would rather do this programmatically, with an image TV, than just dropping them in the page with TinyMCE. The images may be different sizes when they come in. I’d like to specify their size in the page template (e.g. 300px wide), and I want a "list" page using Ditto to list all the documents with a thumbnail image.

    So I made up a Ditto call in the "list" page that worked, but it was using Ditto’s default template. I planned to find an image resizing solution and then roll it into a Ditto template.

    So I Googled and came up with ImageTVPreview, which has absolutely no documentation, and try as I might, I couldn’t come up with how it worked.

    After more Googling I found phpThumb. I found the "modified" version for MODx and installed it. Realizing that now I have to have a Ditto template in order to use it, I Google for help on Ditto templates.

    I found http://ditto.modxcms.com/tutorials/creating-a-custom-template.html - this document shows me a "default" Ditto template:

    <div class="ditto_item" id="ditto_item_[+id+]">
      <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
      <div class="ditto_documentInfo">by <strong>[+author+]</strong> on [+date+]</div>
      <div class="ditto_introText">[+introtext+]</div>
    </div>
    


    I pasted this into a chunk called "albumList," figuring I’d try this to see if it works and modify it from there. I changed my Ditto call from [!Ditto? &startid=’18’&showPublishedOnly=0 !] to [!Ditto? &startid=’18’&showPublishedOnly=0&tpl=’albumList’ !]. Now for each document in the list, it says "&tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it."

    Back to Google. Most of the results are just MODx sites returning the same error. What little else I could find said that it’s because I’m not putting TV names in the template. So I changed the template to contain nothing but the TV name. Same error.

    I’m stuck. I had hoped this would be something so simple that it had been done a thousand times. I need help, I’m losing faith in MODx!
      • 26931
      • 2,314 Posts
      anonymized-26931 Reply #2, 17 years ago
      Hi Mark,
      try this:
      [!Ditto? &startID=`18` &showPublishedOnly=`0` &tpl=`albumList` !]

      use backtick ` instead of single quotes ’

      After more Googling I found phpThumb. I found the "modified" version for MODx and installed it. Realizing that now I have to have a Ditto template in order to use it
      it doesn’t need to be within a Ditto template
        • 26931
        • 2,314 Posts
        anonymized-26931 Reply #3, 17 years ago
        ...and it should be: &startID instead of &startid *fixed it in the call above
        http://www.pogwatch.com/ditto/ditto-parents.html

        So I Googled and came up with ImageTVPreview
        there’s also this:
        http://modxcms.com/extras/package/566
        http://modxcms.com/forums/index.php?topic=38324
          • 18339
          • 14 Posts
          Mark Scudder Reply #4, 17 years ago
          Backticks? That was it? Man, I feel stupid.
            • 18339
            • 14 Posts
            Mark Scudder Reply #5, 17 years ago
            Quote from: sharkbait at Sep 19, 2009, 11:45 AM

            ...and it should be: &startID instead of &startid *fixed it in the call above
            http://www.pogwatch.com/ditto/ditto-parents.html

            So I Googled and came up with ImageTVPreview
            there’s also this:
            http://modxcms.com/extras/package/566
            http://modxcms.com/forums/index.php?topic=38324

            Yeah, that’s TVimageResizer, the one that I mentioned earlier, and the thread you linked, I have the most recent post on that thread, asking why there is no documentation on it anywhere.
              • 18339
              • 14 Posts
              Mark Scudder Reply #6, 17 years ago
              EDIT: Posted a problem I thought I had but I don’t.

              Everything works. Thanks so much. I do feel like an idiot but it’s nice to see I can keep developing now.
                • 26931
                • 2,314 Posts
                anonymized-26931 Reply #7, 17 years ago
                good it’s working now smiley no need to feel stupid about anything