We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46582
    • 2 Posts
    MODX Evolution

    I wonder if someone can help?

    On my site I use this [!Ditto? &parents=`4` &display=`10` &total=`10` &tpl=`ditto-sidebar`!]

    This displays the title of the page and the Summary (introtext.

    What do I need to display a thumbnail image from the page on the front page under title and summary?
      • 9995
      • 1,613 Posts
      The pages under container ID 4 needs a TV where you add the image.

      In the ditto chunk (ditto-sidebar) you need to call <img src="[+image-tv-name+]" />
        Evolution user, I like the back-end speed and simplicity smiley
        • 46582
        • 2 Posts
        Thank you.

        I created a TV called thumbimage.

        This is the code in ditto.

        <div class="sidebar-block">
        <a href="[~[+id+]~]" class="sidebar-block-title">[+pagetitle+]</a>
        <p>[+introtext+]</p>
        <img src="[+thumbimage+]" width="340" />

        </div>
          • 9995
          • 1,613 Posts
          Good luck,

          // documentation;
          http://rtfm.modx.com/extras/evo/ditto
            Evolution user, I like the back-end speed and simplicity smiley
            • 2762
            • 1,198 Posts
            try phpthumb snippet to create a resized thumbnail of your tv "thumbimage"

            ie:

            <img class="thumbnail" src="[[phpthumb? &input=`[+thumbimage+]` &options=`w=340,h=280,zc=TL`]]" alt="[+longtitle+]">
              Free MODx Graphic resources and Templates www.tattoocms.it
              -----------------------------------------------------

              MODx IT  www.modx.it
              -----------------------------------------------------

              bubuna.com - Web & Multimedia Design
              • 20413
              • 2,877 Posts
              Or way better use the thumbnails KCFinder generates on upload.

              1. Install a snippet: phx:thumb
              <?php
              return str_replace('assets/images', 'assets/.thumbs/images', $output);
              ?>
              


              Then in your Ditto TPL: [+thumbimage:thumb+]
              <img src="[+thumbimage:thumb+]" alt="" />


              //KCFinder only generates thumbnails of photo uploads greater than a certain size (I think it's 150px)
              So this is only a solution for pics uploaded greater than that. [ed. note: mrhaw last edited this post 10 years, 2 months ago.]
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower