We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21974
    • 20 Posts
    I am new to developing on MODx. I usually design templates and don’t go much further than that.

    I am building a site for a graphic designer and I am running into a little trouble with trying to pull TV images from documents to display them on a different page. I am basically trying to pull her five most recent portfolio item images as thumbnails and display them as five thumbnail image links that will direct the user to the portfolio item that’s clicked.


    I set the site up so that her portfolio item templates have a TV image upload field for the thumbnail image. [*itemThumbnail*]

    Then I created a chunk to display each image as a link on the homepage.

    <a href="[~[+id+]~]" target="_self">
    <img class="fl" src="[+itemThumbnail+]" alt="" width="95" height="95" />
    </a>

    My Ditto call looks like this:

    [[Ditto? &startID=`9` &summarize=`5` &total=`5` &tpl=`recentWorkImage` ]]

    I am not sure exactly how to achieve this or if I am way off here but any help would be appreciated. It seems like something that should be easy to do but I am thoroughly stumped.

    You can see the homepage where I am trying to work this out here. Laurenmooredesign.com

    Thanks!
      • 16278
      • 928 Posts
      That looks as if it should work, though you could bring the Ditto parameters up to date for v2.1 using &parents rather than &startId and &display rather than &summarize (also &display is redundant if it’s the same as &total). You just need to put the Ditto call in the document where you want the image links to appear.

      What’s going wrong?
      smiley KP
        • 21974
        • 20 Posts
        Hi KP,

        Thanks for the response. I actually got the links to show up now but the images that are uploaded in the TV are not showing up.

        The generated mark up creates a link but does not include the image.

        <a href="[~[+id+]~]" target="_self">
        <img class="fl" src="[+itemThumbnail+]"<--THIS is not doing anything alt="" width="95" height="95" />
        </a>
          • 36592
          • 970 Posts
          Try changing cached form [[...]] to uncached form [!...!].